Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I have data in the below format with the columns 'Metric', 'Actual Value' and 'Metric Format'. Based on the column 'Metric Format', I would like to populate the column 'Desired Outcome' in the visual (matrix) in the output.
Input:
| Metric | Actual Value | Metric Format |
| A | 0.88 | 0% |
| B | 2497 | #,##0 |
| C | 435 | $#,##0 |
Output:
| Metric | Desired Outcome |
| A | 88% |
| B | 2,497 |
| C | $435 |
An ex-employee was able to do this and I am trying to figure out where the settings need to change. Would appreciate if anyone can help.
Solved! Go to Solution.
The below code worked:
Desired Outcome = if( Not(ISERROR(value('TableName'[Actual Value]))), format(value('TableName'[Actual Value]),'TableName'[Metric Format]),'TableName'[Actual Value])
The below code worked:
Desired Outcome = if( Not(ISERROR(value('TableName'[Actual Value]))), format(value('TableName'[Actual Value]),'TableName'[Metric Format]),'TableName'[Actual Value])
Hello there @Rohini ! Check if this works for you:
Desired Outcome =
VAR _current_row =
SELECTEDVALUE ( 'Your Table'[Actual Value] )
RETURN
SWITCH (
_current_row,
"0%", FORMAT ( _current_row, "Percent" ),
"#,##0", FORMAT ( _current_row, "#,0" ),
"#,##0", FORMAT ( _current_row, "$#,0" )
)
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 60 | |
| 49 | |
| 30 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 131 | |
| 103 | |
| 58 | |
| 39 | |
| 31 |