Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Ikalaus
Frequent Visitor

Displaying data

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 $  

 

 

Test_Is_Percentage =
VAR KPI_Name = TRIM(SELECTEDVALUE(KPI_budget[KPI], "Unknown"))
VAR Is_Percentage =
    CONTAINSSTRING(KPI_Name, "Margin %") ||
    CONTAINSSTRING(KPI_Name, "EBITDA %") ||
    CONTAINSSTRING(KPI_Name, "C/R %")
RETURN
IF(Is_Percentage, "Yes", "No")     this work correctly 
 
any idea?
 
1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@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")
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

4 REPLIES 4
Ikalaus
Frequent Visitor

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

v-bmanikante
Community Support
Community Support

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

bhanu_gautam
Super User
Super User

@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")
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.