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
goatman
Frequent Visitor

Filtering total Run hours by status Running and or Not Running

I am using table below to create graphs of Total run hours sliced or filtered by Running Pumps and Not Running Pumps. I have used variuos DAX expressions but dont seem to get it.

-I need to see pumps that are currently running with their cumulative running hours since installation as long as they are still running  or in service.
- I also need to see pumps that are no longer running and their cummulative run hours or achived life. 

I have used the following expressions but not yielding correct result.

1. 

    Runnining Pumps(measure) =
      CALCULATE(SUM('Multistage Pumps'[OP Hrs]),'Multistage Pumps','Multistage Pumps'[Status]="Running"&&'Multistage            Pumps'[Entry Date]>=TODAY()-5) +[2022-Legacy Hours]
2. 
Not Runnining Pumps =
    CALCULATE(SUM('Multistage Pumps'[OP Hrs]),'Multistage Pumps','Multistage Pumps'[Status]="Not Running"&&'Multistage Pumps'[Entry Date]>=TODAY()-5) +[2022-Legacy Hours]
- Days (Day) run to end of month
-I am using entry date >= today to get the current running pumps.
-Some pumps have legacy hours hence the add.
goatman_2-1683698054038.png

 

goatman_0-1683696767181.png

 

goatman_1-1683696767372.png

 

 

 

Would you please help slice the data using status-"Running" and Status- "Not Running"

 

2 REPLIES 2
Anonymous
Not applicable

Hi @goatman ,

 

You want to dynamically display the results that are running and not running, right?

Try the slicer.

Slicers in Power BI - Power BI | Microsoft Learn

 

You can modify it to the following measure and keep one.

    Runnining Pumps(measure) =
      CALCULATE(SUM('Multistage Pumps'[OP Hrs]),FILTER(ALLSELECTED('Multistage Pumps'),'MultistagePumps'[Entry Date]>=TODAY()-5) +[2022-Legacy Hours]....

 

 

Best Regards,

Stephen Tao

 

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

Hi @Anonymous ,

Thank you for the quick response. Unfortunately, when i try to excute the DAX command, i am getting an error

"A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

and what do you mean when you say keep one, i dont seem to get it.

Kind Regards,

@goatman 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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