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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
steveta1
New Member

visual that shows how efficiently each of our machines are running - problem

I have this visual that shows how efficiently each of our machines are running. There's a legend that gives a color to each machine and in total if they reach 100% that means all machines were running at 100% capacity for that 30-minute time period. The measure basically does

 

DIVIDE(efficiency, CALCULATE(DISTINCTCOUNT('MachineData'[Machine]), all(MachineData)))

 

so it calculates the efficiency and divides it by the total number of machines (ignoring the filter that the legend puts on it). Unfortunately, it looks wonky if you filter it by machine then

 

ha1.png

If you select just one machine (like below), it should say the efficiency is near 100% for the 30-minute blocks that it was running. But it's still dividing the efficiency by the total number of machines, because the DAX is using all(MachineData), ignoring the slicer
ha2.png
So I can't figure out how to have it ignore the filter that the legend places on it, but still keep the filter from the slicer. Please help.
 
1 ACCEPTED SOLUTION
ray_ux
Memorable Member
Memorable Member

If you want to keep the first screenshot as it is, have a look at SELECTEDVALUE or HASONEVALUE. Basically, if only one machine is selected, use a different dax without the all.

Maybe try using ALLEXCEPT instead of ALL to keep the machine filtering?

 

Last option maybe replace your ALL(MachineData) with ALL(MachineData[Machine]) with no other changes.

View solution in original post

3 REPLIES 3
ray_ux
Memorable Member
Memorable Member

If you want to keep the first screenshot as it is, have a look at SELECTEDVALUE or HASONEVALUE. Basically, if only one machine is selected, use a different dax without the all.

Maybe try using ALLEXCEPT instead of ALL to keep the machine filtering?

 

Last option maybe replace your ALL(MachineData) with ALL(MachineData[Machine]) with no other changes.

Thank you for the help. I'll look into SELECTEDVALUE/HASONEVALUE. I'm confused about your last suggestion, it calculates the % efficiency for the machine which is good, and then divides it by the distinct count of all machines which is bad because the slicer doesnt affect it

So the legend causes the measure to only have one machine in its table, and I dont know how to have it detect how many machines are selected in the slicer.

It seems the last option  would return all 6 machines still, even if I selected 3 in the slicer, am I misunderstanding?

You are correct.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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