cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Can you switch measure results dynamically

Hello all,

So i've had this question for a while now, but never got to find a correct way of doing this.

Context :

I have an "Evaluations" table, that has test results from multiple establishments.

I have to return the average results for each establishments.

The results are on a scale from 0 to 20.

Pretty easy so far.

Problem :

In a matrix visual, I need to show the average for each establishment, not as number, but as a letter.

For example, if the average of an establishment is 11 out 20, I need to show "C+". If the average is 17 out of 20, I need to show "A". And so on.

For now, I have had to do it all manually with multiple IF functions. It works, but this seems like a terrible solution, espacially if I have to had more IF later...

Isn't there any way to do this dynamically

So far, I have tried with less values, by first building a correspondance table like the following :

 Possible_Results What_I_Want_To_See 1 A 2 B 3 C 4 D 5 E

Then, I tried doing something like this in a measure :
If(

AVERAGE([Establishment_Result]) in [Possible_Results]

,[What_I_Want_To_See]

)

I also tried with SWITCH(), but it doesn't work. I haven't found any threads with similar problems, and I really can't think of anything alse I can try right now. Any clues would be appreciated !

1 ACCEPTED SOLUTION
Super User

@QuangMC ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

To me seem like a case of bucketing/ Dynamic segmentation

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...

Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

2 REPLIES 2
Super User

@QuangMC ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

To me seem like a case of bucketing/ Dynamic segmentation

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...

Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Frequent Visitor

@amitchandak sorry, I just found my answer ^^'

I "just" needed to use a LOOKUPVALUE within my measure...

I tried to use the LOOKUPVALUE function before, but the results weren't what i expected. Turns out, it actually worked as intended, but my data quality was awful, and it ended in bad results.

This is actually pretty easy, I just ruled it out because I though it didn't work...

Sorry to have wasted your time ^^'

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors