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
VTHokie
New Member

DAX to always select value from child table.

Hi,

 

I need a little help with some DAX to always select a value from a child table no matter the filter context.  I have simplified the problem to my core issue in excel.  I have two tables.

 

 Orders

OrderId
100
200
300

 

OrderVersions

OrderIdVersionIdStatusValue
1001Inactive5
1002Inactive10
1003Active30
2001Inactive2
2002Inactive6
2003Active15
2004Pending20
3001Inactive5
3002Active8

 

I want a measure that will always return the Active value for the given OrderId.  I have tried =CALCULATE(SUM([Value]), OrderVersions[Status]="Active") but this only provides the value when the filter context is Status=Active.  

 

Capture.PNG

 

Any help would be appreciated.

 

Mike

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @VTHokie

Create a measure as below

Measure2 = CALCULATE(SUM(Sheet4[Value]),FILTER(ALLEXCEPT(Sheet4,Sheet4[OrderId]),[Status]="Active"))

6.png

 

Best Regards

Maggie

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @VTHokie

Create a measure as below

Measure2 = CALCULATE(SUM(Sheet4[Value]),FILTER(ALLEXCEPT(Sheet4,Sheet4[OrderId]),[Status]="Active"))

6.png

 

Best Regards

Maggie

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.