Skip to main content
cancel
Showing results for 
Search instead 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

Reply
BHAVI2803
Frequent Visitor

What if parameter to define High risk, Medium risk and Low risk value

Hi Power BI Community,

I am facing issue while using What if Parameter to allow user to decide value for High risk, Medium risk and Low risk. Below steps I have used to implement the use case.

1. Created 2 what if parameter for High Risk and Medium risk, which allow user to set the upper limit for both of the categories with the ranges.

2. Created new measure (since calculated column would not be dynamic) using below DAX expression

Risk Category = if(AVERAGE([Column])<'High Risk Parameter'[High Risk Parameter Value],"High Risk",
                    if(AVERAGE([Column])>'Medium Risk Parameter'[Medium Risk Parameter Value],"Low Risk","Medium Risk"))
3. the above calculated working fine on conditional formatting of the report cell color, and even on table report and matrix report.
 
Issue:
 I have to create a bar graph where the created column should be used as dimension and will calculate product count in each risk category, like below:
 BHAVI2803_0-1725898005643.png

I tried but it gives me blank values, since measure can not be used as dimension I think. Need help to find a work around.

 

If some one have worked similar kind of use case please share the solution.

 

Appriciate your time and support in this scenario. 

 

Thank you!

Bhawna Gupta

 

 

2 ACCEPTED SOLUTIONS
mickey64
Super User
Super User

For your reference.

 

Step 0: I use these data tables below.

'DATA' Table

mickey64_0-1725903608941.png

 

'High Risk Parameter' Table

mickey64_1-1725903623966.png

 

'Medium Risk Parameter' Table

mickey64_2-1725903643559.png

 

Step 1: I make 2 slicers and make 5 measures.

mickey64_3-1725903733026.png

M_HighRiskValue = SELECTEDVALUE('High Risk Parameter'[High Risk Parameter Value])

M_MediumRiskValue = SELECTEDVALUE('Medium Risk Parameter'[Medium Risk Parameter Value])

 

M_High Risk = COUNTX(FILTER('DATA','DATA'[Column]<[M_HighRiskValue]),'DATA'[ID])

M_Low Risk = COUNTX(FILTER('DATA','DATA'[Column]<[M_MediumRiskValue]),'DATA'[ID])

M_Medium Risk = COUNTROWS('DATA')-[M_High Risk]-[M_Low Risk]

 

Step 2: I make a 'Clustered column chart'.

mickey64_4-1725903905528.png

 

mickey64_5-1725903942958.png

 

 

 

 

 

 

View solution in original post

For your reference.

 

Step 1: I make a "Parameter". (The slicer is made automatically.)

mickey64_0-1726062482819.png

 

mickey64_1-1726062620076.png

 

mickey64_2-1726062742120.png

 

Step 2: I make a graph.

mickey64_3-1726062813957.png

 

 

View solution in original post

6 REPLIES 6
BHAVI2803
Frequent Visitor

Thank you so much for your solution, I have one more issue, is there any way to create filter for this risk category using what if parameter? Risk category: High Risk, Medium Risk and Low risk, which will slice the information on the desktop

 

Appriciate your response and time

For your reference.

 

Step 1: I make a "Parameter". (The slicer is made automatically.)

mickey64_0-1726062482819.png

 

mickey64_1-1726062620076.png

 

mickey64_2-1726062742120.png

 

Step 2: I make a graph.

mickey64_3-1726062813957.png

 

 

This is perfect, can you please provide the sample data for the use of parameter if possible.

For your reference. (^^)/

 

BHAVI2803
Frequent Visitor

Perfect Thank you so much

mickey64
Super User
Super User

For your reference.

 

Step 0: I use these data tables below.

'DATA' Table

mickey64_0-1725903608941.png

 

'High Risk Parameter' Table

mickey64_1-1725903623966.png

 

'Medium Risk Parameter' Table

mickey64_2-1725903643559.png

 

Step 1: I make 2 slicers and make 5 measures.

mickey64_3-1725903733026.png

M_HighRiskValue = SELECTEDVALUE('High Risk Parameter'[High Risk Parameter Value])

M_MediumRiskValue = SELECTEDVALUE('Medium Risk Parameter'[Medium Risk Parameter Value])

 

M_High Risk = COUNTX(FILTER('DATA','DATA'[Column]<[M_HighRiskValue]),'DATA'[ID])

M_Low Risk = COUNTX(FILTER('DATA','DATA'[Column]<[M_MediumRiskValue]),'DATA'[ID])

M_Medium Risk = COUNTROWS('DATA')-[M_High Risk]-[M_Low Risk]

 

Step 2: I make a 'Clustered column chart'.

mickey64_4-1725903905528.png

 

mickey64_5-1725903942958.png

 

 

 

 

 

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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