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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mm306
Regular Visitor

Using slicer data as result to if else statement

I have the following table. I wish for the Cost values to be provided by the slicer output, whereby each cateogy has a cost slicer that a user can select the value from. Is there a way to do so?

 

I have tried:

Cost = if (Table[Category]="High",[cost_high],if(Table[Category]="Medium",[cost_medium],if(Table[Category]="Low",[cost_low])))

 

with, e.g. cost_high is measure indicating the the selected value from the slicer:

cost_high = SELECTEDVALUE('Level Cost'[High_Cost])

 

Using these codes, all I get is BLANKS.

 

Any help will be most appreciated.

 

Thanks.

 

Customer IDCategoryCost
1High100
2Medium50
3Medium50
4Low10
5Low10
6High100
7High100
8High100
9Low10
10Medium50
4 REPLIES 4
amitchandak
Super User
Super User

@mm306 , that should come by default when you filter using slicer. What is expected outcome?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

example.png

 

Cost = if (Table1[Category]="High",[cost_high],if(Table1[Category]="Medium",[cost_medium],if(Table1[Category]="Low",[cost_low])))

 

And the output for column Cost above is BLANK.

 

Is there a way for the Cost to reflect the slicer output?

 

Thanks.

@mm306 

 

Values in a calculated column are fixed. You'll need to create a measure instead.

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the replies.

May I have some example please, on how to create the measure?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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