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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Vkl
Frequent Visitor

Multiple Data formats inside Switch DAX MEASURE

I have around 10 measures where 5 were just sum aggregation of direct columns and 5 were calculated for percentage. And I wanted to show all these measures in the Matrix visual. So i created a DAX measure using SWITCH() function. Now the isssue is i want to show 5 of those measures in decimal format and the other 5 measures in percentage(%) format. If i change the format of DAX measure which has all the 10 measures to decimal number or percent. All the measures gets updated to that format.

--------------
I have also tried adding in the FORMAT function to show Percent for those specific 5 measures. But the % only shows for Sub total Level and the Individual rows are Blank. 
Example:

IF (
        metrics = "Orders SM%",
        SWITCH (
            TRUE (),
            quarter = "Q1" && year = "2024" && Names = "Actuals", FORMAT([Input_Table_OrdersSM%1Q24], "Percent"),
            quarter = "Q2" && year = "2024" && Names = "Actuals", FORMAT([Input_Table_OrdersSM%2Q24], "Percent"),
            ........
             ......           , 
BLANK ()

)
-------------
Any idea how this can be achieved?


1 ACCEPTED SOLUTION

@bhanu_gautam Thanks for the help! This worked but the individual rows were still blank, so i created a new measure and added all the formats at once and used it as a Value field in the matrix visual. That worked

IF(
NOT(ISBLANK(MetricValue)),
SWITCH(
SelectedMetric,
"Orders", FORMAT(MetricValue, "0.0;(0.0)"),
"Orders SM%", FORMAT(MetricValue/100, "0.0%"),
FORMAT(MetricValue, "0.0") -- Default
),
BLANK()

View solution in original post

5 REPLIES 5
Vkl
Frequent Visitor

@ryan_mayu Appreciate the help! I fixed it

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@Vkl 

maybe you can try isfilter. Below is just a simple example.

 

Measure = if(ISFILTERED('Table'[Column1]),blank(),sum('Table'[value]))
 
11.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




bhanu_gautam
Super User
Super User

@Vkl , Try using

 

DAX
FormattedMeasure =
SWITCH (
TRUE (),
metrics = "Orders SM%" && quarter = "Q1" && year = "2024" && Names = "Actuals", FORMAT([Input_Table_OrdersSM%1Q24], "Percent"),
metrics = "Orders SM%" && quarter = "Q2" && year = "2024" && Names = "Actuals", FORMAT([Input_Table_OrdersSM%2Q24], "Percent"),
metrics = "Sales" && quarter = "Q1" && year = "2024" && Names = "Actuals", FORMAT([Input_Table_Sales1Q24], "0.00"),
metrics = "Sales" && quarter = "Q2" && year = "2024" && Names = "Actuals", FORMAT([Input_Table_Sales2Q24], "0.00"),
...
BLANK()
)




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

Proud to be a Super User!




LinkedIn






@bhanu_gautam Thanks for the help! This worked but the individual rows were still blank, so i created a new measure and added all the formats at once and used it as a Value field in the matrix visual. That worked

IF(
NOT(ISBLANK(MetricValue)),
SWITCH(
SelectedMetric,
"Orders", FORMAT(MetricValue, "0.0;(0.0)"),
"Orders SM%", FORMAT(MetricValue/100, "0.0%"),
FORMAT(MetricValue, "0.0") -- Default
),
BLANK()

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.