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! Get ahead of the game and start preparing now! Learn more
I need to display the whole number as currency and if it is percent with 5 in the matrix view
Formatted_Revenue =
VAR KPI_Name = TRIM(SELECTEDVALUE(KPI_budget[KPI], "Unknown"))
VAR Is_Percentage =
KPI_Name IN {"Service Margin %", "Gross Margin %", "EBITDA %", "C/R %"}
VAR Raw_Value =
CALCULATE(
SUM(KPI_budget[Revenue_budget]),
ALLEXCEPT(KPI_budget, KPI_budget[KPI], KPI_budget[fin_kpi])
)
VAR Percent_Value = Raw_Value * 100
RETURN
IF(
Is_Percentage,
FORMAT(Percent_Value, "$#,##0.00") & "%", -- Format the percentage with $ symbol
FORMAT(Raw_Value, "$#,##0.00")
).
What is the issue with this code? everything is showing with $
Solved! Go to Solution.
@Ikalaus , Try using
DAX
Formatted_Revenue =
VAR KPI_Name = TRIM(SELECTEDVALUE(KPI_budget[KPI], "Unknown"))
VAR Is_Percentage =
KPI_Name IN {"Service Margin %", "Gross Margin %", "EBITDA %", "C/R %"}
VAR Raw_Value =
CALCULATE(
SUM(KPI_budget[Revenue_budget]),
ALLEXCEPT(KPI_budget, KPI_budget[KPI], KPI_budget[fin_kpi])
)
VAR Percent_Value = Raw_Value * 100
RETURN
IF(
Is_Percentage,
FORMAT(Percent_Value, "0.00") & "%", -- Format the percentage without $ symbol
FORMAT(Raw_Value, "$#,##0.00")
)
Proud to be a Super User! |
|
Thanks! i find another way to fix
Hi @Ikalaus ,
Since your issue appears to be resolved, kindly mark the relevant response as the accepted solution. This helps other community members quickly find answers to similar problems.
Thank you for your support and collaboration!
Regards,
B Manikanteswara Reddy
Hi @Ikalaus,
Just checking in — if the solution provided by the Super User resolved your issue, please consider marking it as the accepted answer.
If you're still facing trouble, could you please share a small sample of your dataset (ensuring it doesn't contain any sensitive information) along with the expected result? That would help in guiding you further.
Regards,
B Manikanteswara Reddy
@Ikalaus , Try using
DAX
Formatted_Revenue =
VAR KPI_Name = TRIM(SELECTEDVALUE(KPI_budget[KPI], "Unknown"))
VAR Is_Percentage =
KPI_Name IN {"Service Margin %", "Gross Margin %", "EBITDA %", "C/R %"}
VAR Raw_Value =
CALCULATE(
SUM(KPI_budget[Revenue_budget]),
ALLEXCEPT(KPI_budget, KPI_budget[KPI], KPI_budget[fin_kpi])
)
VAR Percent_Value = Raw_Value * 100
RETURN
IF(
Is_Percentage,
FORMAT(Percent_Value, "0.00") & "%", -- Format the percentage without $ symbol
FORMAT(Raw_Value, "$#,##0.00")
)
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 35 | |
| 34 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 99 | |
| 73 | |
| 66 | |
| 65 |