Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi Everyone,
I need help on solving my current issue.
I have a sales table that has 3 columns : Item No, Gen No and Qty.
I have a slicer for Item No. If i select a No, i would like to check the "No" selected on the "No" Column and also check if the number is present in the "Gen No" Column and return a sum of quantity where this is fulfilled.
Below is an illustration of my table and the exprected result
No | Gen No | Qty |
1 | 0 | 4 |
2 | 0 | 6 |
3 | 2 | 8 |
4 | 1 | 3 |
5 | 3 | 5 |
Expected Result
No | Qty |
1 | 7 |
2 | 14 |
3 | 13 |
4 | 3 |
5 | 5 |
Thanks
Solved! Go to Solution.
@KayCent try this measure, In expression, change table and column name as per your data model.
Sum Qty =
VAR __no = MAX ( 'Table (2)'[No] )
VAR __qty = SUM ( 'Table (2)'[Qty] )
VAR __genNoQty = CALCULATE( SUM ( 'Table (2)'[Qty] ), ALL ( 'Table (2)'[No] ), 'Table (2)'[Gen No] = __no )
RETURN __qty + __genNoQty
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@KayCent not sure it is clear how you are getting the query in output table. can you clarify
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks .
It is a sum of the Qty value where the No is present in the Gen No Column
No | Qty |
1 | 4+3 = 7 |
2 | 6+8=14 |
3 | 8+5=13 |
4 | 3 |
5 | 5 |
@KayCent I see, in original post, you mentioned just sum where gen no value match with no but you are adding the value of no row + value of gen no which matches with no, correcT?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Correct.
@KayCent try this measure, In expression, change table and column name as per your data model.
Sum Qty =
VAR __no = MAX ( 'Table (2)'[No] )
VAR __qty = SUM ( 'Table (2)'[Qty] )
VAR __genNoQty = CALCULATE( SUM ( 'Table (2)'[Qty] ), ALL ( 'Table (2)'[No] ), 'Table (2)'[Gen No] = __no )
RETURN __qty + __genNoQty
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Many Thanks. still did not get the desired result.
It seems it does not include this
VAR __genNoQty = CALCULATE( SUM ( 'Table (2)'[Qty] ), ALL ( 'Table (2)'[No] ), 'Table (2)'[Gen No] = __no ) R
It shows no values for the above Variable.
@KayCent here is the output based on your dataset, not sure if there is other tables/filters have an impact
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks alot @parry2k for your time and patience.
It worked!!!
As you said, there was another filter impacting it.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
84 | |
66 | |
62 | |
62 |
User | Count |
---|---|
199 | |
120 | |
110 | |
79 | |
69 |