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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Formating a mesure using different mesure

Hello everyone,

 

In a project i would like to use different mesure in a single one but i have some difficulties to do it.

For exemple in my dataset i have 4 mesure CA and UC in decimal and DN and DV in percentage. I created a new table KPI list with my KPI name and a column order. 
I would like to calculate a new mesure KPI selected : 

KPI selected =
VAR SelectedKPI = SELECTEDVALUE('KPI list'[Order])
RETURN
    SWITCH(
        SelectedKPI,
        1,[CA],
        2,[UC],
        3,[DN],
        4,[DV],
    )
 
 

The point is to have a segment KPI list and when i select CA or UC my bar chart use the KPI selected and he is in decimal and when i select DN or DV  the barchart is now in percentage.

 

Is this possible ? 

Thank you 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Thanks @bhanu_gautam  for the quick reply and solution. You can place the measure provided by @bhanu_gautam  on the data label of the column chart.

vtangjiemsft_0-1721099939098.png

vtangjiemsft_1-1721100018121.png

 

Or we can create dynamic format strings for measure.

Create dynamic format strings for measures in Power BI Desktop - Power BI | Microsoft Learn

vtangjiemsft_2-1721100099002.png

vtangjiemsft_3-1721100128983.png

KPI selected = 
VAR SelectedKPI = SELECTEDVALUE('KPI list'[Order])
RETURN
    SWITCH(
        SelectedKPI,
        1,[CA],
        2,[UC],
        3,[DN],
        4,[DV]
    )
SWITCH(SELECTEDVALUE('KPI list'[Order]),
1,"0.00",
2,"0.00",
3,"0.00%",
4,"0.00%")

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Thanks @bhanu_gautam  for the quick reply and solution. You can place the measure provided by @bhanu_gautam  on the data label of the column chart.

vtangjiemsft_0-1721099939098.png

vtangjiemsft_1-1721100018121.png

 

Or we can create dynamic format strings for measure.

Create dynamic format strings for measures in Power BI Desktop - Power BI | Microsoft Learn

vtangjiemsft_2-1721100099002.png

vtangjiemsft_3-1721100128983.png

KPI selected = 
VAR SelectedKPI = SELECTEDVALUE('KPI list'[Order])
RETURN
    SWITCH(
        SelectedKPI,
        1,[CA],
        2,[UC],
        3,[DN],
        4,[DV]
    )
SWITCH(SELECTEDVALUE('KPI list'[Order]),
1,"0.00",
2,"0.00",
3,"0.00%",
4,"0.00%")

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

bhanu_gautam
Super User
Super User

@Anonymous , Try using below measure


KPI selected formatted = 
VAR SelectedKPI = SELECTEDVALUE('KPI list'[Order])
RETURN
    SWITCH(
        SelectedKPI,
        1, FORMAT([CA], "0.00"),
        2, FORMAT([UC], "0.00"),
        3, FORMAT([DN], "0.00%"),
        4, FORMAT([DV], "0.00%")
    )




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

Proud to be a Super User!




LinkedIn






Anonymous
Not applicable

Hello, i have already tried to do this and it works in table and matrix but when it's in graph i can't use it because power bi think the mesure is a format text

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.