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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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