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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
FRG
Resolver I
Resolver I

Total with many condition

Hi,

Here's my table:

Capture.JPG

 

How can I calculate the volume of a RUN (or many RUN) by choosing a length who was produce in this (or these) RUN?

e.g. length 8. Only in the RUN M241 for a total volume of 4,3.

e.g. lengtt 11,5. In Run M241 and M242 for a total volume of 12,3.

 

How can I calculate the volume of a RUN (or many RUN) by choosing a User_ID who works in this (or these) RUN?

e.g. User_ID 6 works in RUN M241 and M242 = 12,3.

e.g. User_ID 11 works in RUN M242 = 8.

*This measure works: CALCULATE(SUMX(table;table[VOLUME]);all(table[LENGTH))

 

How can I calculate the volume of a RUN (or many RUN) by choosing a User_ID who works and a length who was produce in this (or these) RUN?
e.g. length 11,5 and User_ID 6 =  Volume of 2,3.

e.g. length 8 and User_ID 4 =  Volume of 5,7.

 

I hope I gave enough information to receive your help.

Thanks

1 ACCEPTED SOLUTION

I succeeded to have the expecting result. In another table I have the Run so I made this measure and it works:

CALCULATE(CALCULATE(SUMX(table;table[Volume]);ALL(table[Length]);RELATEDTABLE(RUN))

Thanks for your support.

View solution in original post

5 REPLIES 5
lc_finance
Solution Sage
Solution Sage

Hi @FRG ,

 

 

You can download my proposed solution from here.

Based on your description, I think Power BI slicer should do the job and we don't need to add specific formulas.

 

Below is a screenshot based on your third example:

Run length.png

 

Does this help you?

 

LC

Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com

Thanks @lc_finance ,

But the expected result with these slicer should be the total of volume of all the RUN where the length 11,5 was produce. Same things for User_ID. In that case the total volume is for RUN M241 is 4,3 and for RUN M242 it's 8.

Thanks for your time.

Hi @FRG 

 

 

thank you, I understand better the question now.

You can do that using ALL. You can download my updated solution from here.

 

You can add a measure with the following formula:

Unfiltered volume = CALCULATE(SUM('Run Table'[VOLUME]), ALLEXCEPT('Run Table','Run Table'[RUN]))

 

This is a screenshot of the solution:

Run length.png 

 

Let me know if this is what you are looking for.

 

LC

Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com

Hi,

This is a screen shot of expected result when filtered bu User_ID and Length.

Capture.JPG

This is the complexity. I'm looking for a measure who gives expecting result with many different filter.

Thanks

I succeeded to have the expecting result. In another table I have the Run so I made this measure and it works:

CALCULATE(CALCULATE(SUMX(table;table[Volume]);ALL(table[Length]);RELATEDTABLE(RUN))

Thanks for your support.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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