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
Anonymous
Not applicable

MIN Value of Multiple Columns across Multiple Tables with a Shared Table

Hello Power BI Community!! 

 

I am fairly new to DAX and having a few issues writing an expression for the below logic statement. I've attempted a few combinations of IF, RELATED, MIN/MINX with no luck. 

 

Avail_Transfer_Qty = IF 'OpenUsageTable'(OpenUsage Qty) >= 'ExcessTable'(Excess Qty)

                                      THEN 'ExcessTable'(Excess Qty)

                                       NOT  'OpenUsageTable'(OpenUsage Qty)

 

Data Model:  *Relationships use "Product" as Shared Value

 

Data Model Example.PNG

 

 

Thank you very much in advance for any help!! Please let me know if you would like any additional information.

 

 

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

are you looking for a calculated measure or a column?

Column makes sense in the Product table, you can then use RELATEDTABLE with to get all the relevant rows from Open and Excess tables, sum the quantities (with SUMX) and then compare the aggregates


for measure you can use TREATAS
https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

but for the comparison you should first aggregate values from Open and Excess

 

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

are you looking for a calculated measure or a column?

Column makes sense in the Product table, you can then use RELATEDTABLE with to get all the relevant rows from Open and Excess tables, sum the quantities (with SUMX) and then compare the aggregates


for measure you can use TREATAS
https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

but for the comparison you should first aggregate values from Open and Excess

 

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

This worked great! Thank you!!

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.

Top Solution Authors