The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi PBI experts
I am unable to write DAX for below scenario.
In given Data table, measure to find out sum of qty where at least one of Com typ is C for each ID
Company | Com typ | PID | id | Qty. |
A | others | 1 | 281552 | 85 |
C | C | 1 | 281552 | 160 |
A | others | 1 | 281552 | 80 |
C | C | 2 | 382990 | 60 |
A | Others | 2 | 382991 | 40 |
B | Others | 3 | 382991 | 45 |
B | Others | 3 | 223812 | 138 |
C | C | 3 | 223812 | 32 |
Result- 555
Thanks
@amitchandak Sorry to tag you like that but saw your replies on various queries so thought you might be the right person. Any ideas about this one?
Thanks
Radhika
Thanks for reply but this DAX will filter C and sum of only those qty
I need sum of all the rows (Qty) for IDs which have com typ as C. In above data except ID 382991 all others have C so, result as 555.
Hi @Anonymous,
You can use the following DAX function -
Sum Of Quantity = CALCULATE( SUM ('Table'[Qty]), FILTER ('Table', 'Table'[Com typ]) = 'C' )
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks
Radhika
User | Count |
---|---|
24 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |