cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
QuangMC
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_ResultsWhat_I_Want_To_See
1A
2B
3C

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 !

 

Thank you in advance !

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

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

Appreciate your Kudos.

 

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

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

Appreciate your Kudos.

 

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

@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 ^^'

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors