cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

My source chart done through Excel generated this correctly

My Power BI chart looks like this

Super User

Hi,

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

Regards,
Ashish Mathur
http://www.ashishmathur.com
Frequent Visitor

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

Super User

Hi,

Regards,
Ashish Mathur
http://www.ashishmathur.com
Frequent Visitor

Hmm how do I attach a file here?

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors