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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.