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 all,
I have a table which looks as follows:
Particular | Prior Month (Period <2) | Year to date |
Cost | 450 | 825 |
Revenue | 690 | 1370 |
Profit % | 0.533333333 | 0.660606061 |
Units Sold | 10 | 700 |
But I want it to be formatted as the following table that is by row.
Particular | Prior Month (Period <2) | Year to date |
Cost | £ 450.00 | £ 825.00 |
Revenue | £ 690.00 | £ 1,370.00 |
Profit % | 53.33% | 66.06% |
Units Sold | 10 | 700 |
Can you please help me to achieve this?
Thanks.
Kind regards,
Jason
Solved! Go to Solution.
Hi @JasMack,
Current power bi does not support shows multiple formats in one value field, if you want to display different formats, you need to convert this field data type to text at first.
Then you can use Dax format to replace and format current results based on conditions.
Measure formulas:
P<2 =
VAR currPart =
SELECTEDVALUE ( 'Table'[Particular] )
VAR val =
SUM ( 'Table'[Prior Month (Period <2)] )
RETURN
FORMAT (
val,
IF (
currPart IN { "Cost", "Revenue" },
"Currency",
IF ( currPart = "Profit %", "Percent", "Standard" )
)
)
YTD =
VAR currPart =
SELECTEDVALUE ( 'Table'[Particular] )
VAR val =
SUM ( 'Table'[Year to date] )
RETURN
FORMAT (
val,
IF (
currPart IN { "Cost", "Revenue" },
"Currency",
IF ( currPart = "Profit %", "Percent", "Standard" )
)
)
FORMAT function (DAX) - DAX | Microsoft Learn
Regards,
Xiaoxin Sheng
Hi @JasMack,
Current power bi does not support shows multiple formats in one value field, if you want to display different formats, you need to convert this field data type to text at first.
Then you can use Dax format to replace and format current results based on conditions.
Measure formulas:
P<2 =
VAR currPart =
SELECTEDVALUE ( 'Table'[Particular] )
VAR val =
SUM ( 'Table'[Prior Month (Period <2)] )
RETURN
FORMAT (
val,
IF (
currPart IN { "Cost", "Revenue" },
"Currency",
IF ( currPart = "Profit %", "Percent", "Standard" )
)
)
YTD =
VAR currPart =
SELECTEDVALUE ( 'Table'[Particular] )
VAR val =
SUM ( 'Table'[Year to date] )
RETURN
FORMAT (
val,
IF (
currPart IN { "Cost", "Revenue" },
"Currency",
IF ( currPart = "Profit %", "Percent", "Standard" )
)
)
FORMAT function (DAX) - DAX | Microsoft Learn
Regards,
Xiaoxin Sheng
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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |