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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Apple08
Helper IV
Helper IV

SumX with multiple filters

Hi All

 

I have a DAX below to get the Planning[Planned_hours], however I need to add in more filters Planning[Status] = "Red" or "Amber" or "Green".

Please could anyone help?  Many thanks.

 

Planned Hours = SUMX(FILTER(Planning,Planning[name]='Supplier'[Supplier] && Planning[MMM-YY]='Supplier'[MMM-YY]),Planning[Planned_hrs])

 

1 ACCEPTED SOLUTION
sjoerdvn
Super User
Super User

Planned Hours = SUMX(FILTER(Planning,Planning[name]='Supplier'[Supplier] && Planning[MMM-YY]='Supplier'[MMM-YY] && Planning[Status] IN {"Red","Amber","Green"}),Planning[Planned_hrs])

View solution in original post

4 REPLIES 4
sjoerdvn
Super User
Super User

Planned Hours = SUMX(FILTER(Planning,Planning[name]='Supplier'[Supplier] && Planning[MMM-YY]='Supplier'[MMM-YY] && Planning[Status] IN {"Red","Amber","Green"}),Planning[Planned_hrs])

It works perfectly!  Many thanks!

Apple08
Helper IV
Helper IV

Thanks sjoerdvn.  I did use the filter to filter planned hours to only Red, Green and Amber, however it only works when the planned hours are in it's own Planning table.  I need to create a column of planned hours in another table Supplier, so I used the DAX to look for planned hours from Planning table.  The DAX is to create a planned hour column in the Supplier table, however once planned hours are shown, they included other categories but not only Red, Green and Amber.  Therefore I wonder can I add in more filters into the DAX to get the correct planned hours from Planning table into Supplier table.

sjoerdvn
Super User
Super User

Can you provide more context? Are you building a measure or a computed column? Does the DAX above even work? Have you tried to simply add a filter or slicer on Planning[Status] ?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.