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

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

Reply
Anonymous
Not applicable

if else in Power Bi calculated column

Hi everyone, 

Im trying to create a range where value is "Less than 50", "More than 50" and "More than 150". I was able to achieve this but I want values that are more than 50 to display inclusive of values more than 150 as well. User should have an option to only to view all data that are more than 50 and if they want to view values more than 150 they should be able to select that.

Range = SWITCH(
TRUE(), 
'All'[Value (USD)] < 50, "Less than 50",
'All'[Value (USD)] > 50 && 'All'[Value (USD)] < 150 , "More than 50",
'All'[Value (USD)] > 150, "More than 150")

This code will segregate data with value 50 and 150. I would like to know if its possible to display data that are more than 50 & 150 when user select "More than 50". If user selects more than 150 then it will only display data with value more than 150.
I hope someone could give a suggestion for this 🙂

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

you can create or import a separate disconnected table that contains the three text descriptions of the three rangges let's call it 'Ranges' that contains one column [Range]. Inserr a sclicer based on 'Ranges[Range]. Place the following measure in the filter pane of the visual, select "is not blank" and apply the filter

Range =
SWITCH (
    SELECTEDVALUE ( Ranges[Range] ),
    "Less than 50", COUNTROWS ( FILTER ( 'All', 'All'[Value (USD)] < 50 ) ),
    "More than 50", COUNTROWS ( FILTER ( 'All', 'All'[Value (USD)] > 50 ) ),
    "More than 150", COUNTROWS ( FILTER ( 'All', 'All'[Value (USD)] > 150 ) )
)

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi its alright I made it work, thank you for your input 🙂

Anonymous
Not applicable

Its an empty table when i create a table using this measure. When I use it as a slicer for my existing dashboard it only shows More than 150. 

tamerj1
Super User
Super User

Hi @Anonymous 

you can create or import a separate disconnected table that contains the three text descriptions of the three rangges let's call it 'Ranges' that contains one column [Range]. Inserr a sclicer based on 'Ranges[Range]. Place the following measure in the filter pane of the visual, select "is not blank" and apply the filter

Range =
SWITCH (
    SELECTEDVALUE ( Ranges[Range] ),
    "Less than 50", COUNTROWS ( FILTER ( 'All', 'All'[Value (USD)] < 50 ) ),
    "More than 50", COUNTROWS ( FILTER ( 'All', 'All'[Value (USD)] > 50 ) ),
    "More than 150", COUNTROWS ( FILTER ( 'All', 'All'[Value (USD)] > 150 ) )
)

 

Anonymous
Not applicable

Hi @tamerj1 ,
Ive tried the suggested method but it only displays "More than 150" even when all 3 ranges are in table.

@Anonymous 
Would you please share a screenshot of what you've achieved so far?

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.