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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Syndicate_Admin
Administrator
Administrator

I need a measurement that is calculated only if values are selected in a slicer

Dear Community,

I have 3 sizes, cost_enginehr_total, cost_fuel_total and cost_labor_total

But I need that the measurement cost_enginehr_total only be calculated for the machines that are selected in the slicer that I show below but that although I do not select any (and therefore that specific measure is not calculated) I can continue to observe the rest of the machines with the other two remaining measures cost_fuel_total and cost_labor_total.

2022-05-24 11_58_55-fleet_metrics_connected - Power BI Desktop.png

Thank you for your support

5 REPLIES 5
Syndicate_Admin
Administrator
Administrator

Hola Arul,

Yes... what I try to look for is that specifically the measure "cost_enginehr_total" is only calculated for the machines you select in the slicer, while the other two measures should always be calculated... I attach a reference image that more less is what I am looking for...

2022-05-25 10_04_58-Greenshot image editor.png

Hi @Syndicate_Admin  @calonzo2078 

It looks like you only need to change cost_enginehr_total, try the following code and replace 1 with your calculated expression

vxiaotang_0-1653641583410.png

Measure = IF(MIN('Table'[machine_name]) in ALLSELECTED(slicer), ,BLANK())

Kindly note: put the column in slicer table into Slicer visual

vxiaotang_1-1653641785324.png

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Hello!!

Create a measure called "cost_enginehr_total_test" to test your solution and this is what results

calonzo2078_0-1654004303774.png

Whereas the "slicer" comes from the "machine_name" column of the "machine" table

1. Here's what happens if I don't select any machines in the slicer:

calonzo2078_1-1654004422288.png

2. If I select at least two "machine", it only shows me information of the selected machines

calonzo2078_2-1654004476163.png

And I should show the information as it is seen in the test that you did previously with your proposed solution ..

What may be happening???

Arul
Super User
Super User

@Syndicate_Admin ,

Does this needs to be calculated for cost_enginehr_total while selection happens in the measure?

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


This is Arul...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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