Formatting a 'card' in Power BI to show millions to 2 dp, or thousands to 1 dp - formatting

I have some cards set up that show numbers. I have the formatting set up to "Auto" display unites and Value decimal places set to 2.
The issue I have is when the numbers show in million, that show nicely as $2.28m for example. However, if they're in thousands they show $120.50k as an example.
I'd like to be able to format the cards so if they're showing millions it shows as 2 decimal places, but if the number is int he thousands it shows 1 dp.
Is this possible? I'm very new to Power BI and dax so I'm hoping there i a quick solution.
TIA

Related

How to convert a panel bar chart to multi-line chart in tableau

I am trying to create multi-line subplots such that each subplot represents a rating factor on which firms are rated, and each line represents a firm's change in rating over time. Note that I don't have the date field. I have a string field that says which quarter of the year the Mean of ratings belong to.
I'm new to tableau and I created something like this:
I want to create multiple subplots: one subplot for each of the 8 rating features in the above diagram, and the subplot has multiple lines representing the variation over time for each company. I have 10 companies.
Please guide me on how to achieve this?
A rough sketch of how I Imagine the plot to look like is below:
This will teach you how to make a panel chart in Tableau: https://tarsolutions.co.uk/blog/build-a-dynamic-panel-chart-in-tableau/
It shouldn't to too complex for what you're attempting (fingers crossed!).
Building the panel chart is a little tricky in Tableau. Not terribly hard once you understand table calcs. I suggest starting simpler by moving Measure Names from the Rows shelf to the Pages shelf, then creating the line charts you want - 1 per page. Then learn about table calc partitions and addressing, including “At the Level” to have the info needed to define the panels
To make a colored line chart,
You need one field on columns that you set to display as continuous, making it green. If it is a date field, right click on the field and choose from the second set of groups, like month or quarter.
You need a continuous field on the Rows shelf, use Measure Values in your case
Use a discrete field on color to determine the number of lines, say Shortname
Set the Mark Type to either Automatic or line

power bi: dynamic y-scale values based on data

I'm building a dashboard in power bi and I have a dataset with a few percentages. There are several categories of data, but only one category is shown at a time. What I want to do is to dynamically change the y-axis values to reflect the data. At the moment, it's done automatically, but it makes the data look "worse" than it is, so I want to take the min and the max for that one category and add let's say another 10-20% to it, and use those values as the new scale. For example, if my data starts at 41% and ends at 63%, power bi automatically scales the chart between around 40% and 65%. I want to take these values, add 10% on each side and have the chart start at 30% up to 75% (roughly).
Is there a way to do this?
Thanks
If your visual is a line diagram then you can solve it by adding two additional measures to the plot:
y_top = MAX([pct_measure])+0,1
y_bottom = MIN([pct_measure])-0,1
Add both to the line diagram and then set their line widths to 0.
It's a variation of this:
Power Bi Tips - Center X-axis on a line chart

Conditional cell formatting on SSRS pivot table

I created a pivot table in SQL that has report names along the left side, and hours (00:00, 00:01, etc.) along the top. The values in the table are the number of times each report has been used during that hour over the past three months. I've imported the table into SSRS, and I'm trying to create a heat map of sorts. I want to color the cells darker or lighter across the row based on the number in each cell compared to the value of cells across the row (cell that has the highest value will be the darkest colored).
I've tried following this guide to color the cells, but here the entire row is one field, while I have separate fields for each column. Is there a way to achieve this?
EDIT: Added picture of table design, and preview where coloring is done incorrectly
I understand your problem better now...The function uses the min and max values of a column to determine the range from lightest to darkest, then it probably looks at what fraction of the range your actual value is. In your case where you have each column's data coming from a different cell it'll be a pain unless your columns are fixed and even then it's more trouble than it needs to be.
I would suggest the following.
DON'T PIVOT your data in SQL, we can do that really easily in SSRS, your dataset will be simpler too something like
ReportName Hour UsageCount
ReportA 0 8
ReportA 1 4
ReportC 22 18
and so on...
Create a new report and add a matrix with reportName as the row group and hour as the column group. The data values will be UsageCount.
That's it for the report design, then just set the cells back ground based on your function but this time you can pass in Max(Fields!UsageCount.Value) etc as per the sample.
I've rushed this a bit so it if not clear, let me know and I'll post a clearer solution.

Need to display value upto two decimal digits in SSRS report

I need to display discount % up to two places of decimal in a SSRS report. The current expression that i am using is "Fields!Discount.Value" and its generating inconsistent values in the report.
In the top designer bar in the number field, change it from Default to Number. Then use the little decimal buttons to adjust how many decimals you will allow to be shown.
I don't have enough rep to post images, but screen shot link below.
Screen Shot

I am trying to create a calculated field from multiples columns by each row in Tableau

I have 5 columns.
SAMPLE HIGH MEDIUM LOW TOTAL
A________________5______________4______________7_____16
B________________5______________4______________7_____16
C________________5______________4______________7_____16
D________________5______________4______________7_____16
I want to be able to calculate for each sample the percentage of High Medium Low.
High/ total = new value
medium/total = new value
low/total=new value
How do I do this in Tableau?
You can read here for more details, but the general way is to right click on the Dimensions or Measures small window and then click on Create Calculated Field.
When the windows opens, in your case, you'll want to create a new name for the 'New Value', and then for the Formula section you should put:
[HIGH]/[TOTAL]
Just make sure that these are recognized as floats or integers (and not strings). If you select the variables in the Fields section, you are more likely to get exactly what you want. Also, there is a preview on the right of the data type.