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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

how to use what if parameters using IF or SWITCH statement

how to use what if parameter using IF or SWITCH statement

what if parameter value is 0 to 100

 

if statment is:

if (days<=10,"<10",

if (days >10 && days<=20,"10 to 20",

if (days >20 && days<=30,"20 to 30",

if(days >30 && days<=40,"30 to 40", "morethan 40")

 

I need to use what if parameter value in the palce of <=10, >10 && <20 etc

if (days<=whatifparameter value,"<10",

if (days > whatifparameter value && days<=whatifparameter value,"10 to 20" (this is should like whatifparameter value to whatifparameter value),

if (days >whatifparameter value && days<=whatifparameter value,"20 to 30"this is should like whatifparameter value to whatifparameter value),

if(days >whatifparameter value && days<=whatifparameter value,"30 to 40 (this is should like whatifparameter value to whatifparameter value), "morethan 40")

 

could you please help me how to use waht if parameter values in IF or SWITCH statements?

 

1 REPLY 1
Gabriel_Walkman
Continued Contributor
Continued Contributor

Did you tru googling at all?

 

Here's some ideas https://community.powerbi.com/t5/Desktop/if-then-else/m-p/117999

 

Though I'm not sure what you are asking about the whatifparameter. Have a google at dax variables.

 

In your examples you don't need the > checks at all. It's already covered by the previous if. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.