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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
MTTsoftwareuser
Frequent Visitor

DAX Filtering on a Column (Twice) and then Dividing the Related Data from Other Columns

Amongst my table I have Columns that include [Has WO], [Multiple WO], and [Hours].  I want to find all of my records where [Has WO] = "YES" and divide those records where [Has WO] = "YES" and [Multiple WO] = "Multiple" but I want to divide the [Hours] that are associated with the first filter by the [Hours] associated with the second filter.  So, let's say there are 20 records that satisfy the first condition and 80 that satisfy the second condition - the result shouldn't be (or likely won't be) 25% because the 20 records might have 102 hours associated and the 80 records might have 405 hours - I want the 102/405.  I came up with this but I don't think it is working...

 

Chart 4b = DIVIDE(
CALCULATE(
SUM ('Data'[Hours]),
FILTER (Data,Data[Has WO] = "YES")),
CALCULATE(
SUM ('Data'[Hours] ),
FILTER (Data,'Data'[Has WO] = "YES" && (Data[Multiple WO] = "MULTIPLE")
)
))
 
Thanks!
6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

What exact problem are you facing?  Also, your formula can be simplified to:

Chart 4b = DIVIDE(CALCULATE(SUM ('Data'[Hours]),Data[Has WO] = "YES"),CALCULATE(SUM ('Data'[Hours]),'Data'[Has WO] = "YES",Data[Multiple WO] = "MULTIPLE"))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

My source chart done through Excel generated this correctly

MTTsoftwareuser_0-1682234665467.png

My Power BI chart looks like this

4a.jpg

Hi,

In the Formatting pane, edit the Y axis intervals/numbers


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks - but nothing here is changing the result...

 

c4.png

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hmm how do I attach a file here?

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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