Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Everyone,
I have a data table that looks like this:
The data table name is "Region Sales" and the column headers are as shown above.
I want to show this as a table visual exactly like this where the second row "% of Sales" is a decimal while the first row is a whole number.
Is there a way to do this? Thank you!
Solved! Go to Solution.
Hi @Anonymous
In addition to amitchandak 's reply, the wrong condition of category in IF function caused the incorrect result in your measure.
In your screenshot I found you have three categorys.
Firstly, the measure amitchandak built has incorrect category.
Incorrect category: "Sales unit Cost", your category is "Sales unit Count".
Logic of IF in Dax: IF(<logical_test>, <value_if_true>[, <value_if_false>])
If you use category "Sales unit Count" to be the condition in IF function in your measure, all other categorys except "Sales unit Count" will return to the results with dots.
You can update your measure as below.
Measure =
if(max('Table'[Category]) = "% of Sales", format(MAX('Table'[Value]), "#,###.#"),Format(MAX('Table'[Value]), "#,###"))
My Sample:
Result is as below:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
In addition to amitchandak 's reply, the wrong condition of category in IF function caused the incorrect result in your measure.
In your screenshot I found you have three categorys.
Firstly, the measure amitchandak built has incorrect category.
Incorrect category: "Sales unit Cost", your category is "Sales unit Count".
Logic of IF in Dax: IF(<logical_test>, <value_if_true>[, <value_if_false>])
If you use category "Sales unit Count" to be the condition in IF function in your measure, all other categorys except "Sales unit Count" will return to the results with dots.
You can update your measure as below.
Measure =
if(max('Table'[Category]) = "% of Sales", format(MAX('Table'[Value]), "#,###.#"),Format(MAX('Table'[Value]), "#,###"))
My Sample:
Result is as below:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You can try something like this if category is row
if(max(Table[categorty]) = "Sales unit Cost", format([value], "#,###"), format([value], "#,###.#"))
Please correct the format as per need.
or if these are two measures, then you can use a matrix with "Show on row". each measure can have its own format.
Hi @amitchandak ,
So overall, your solution worked! I'll be sure to click on the "accept as solution" button. But before I do, I have one more question. When I used your function, it correctly shows the line I want as a decimla while keep the other 2 lines as a while number, however, as you can see below, there is still a period at the end of 12,189 & 1,000. Is there a way to get rid of that period? I tried playing around with your function with no luck.
Thanks!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |