Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I would like to seek some helps for the DAX to summarize the "QTY" by "ID". However, I would like to Filter the "Status" to Ordered only before summarize.
ID | QTY | Status |
1 | 7 | Ordered |
1 | 4 | Cancelled |
2 | 2 | Ordered |
2 | 8 | Cancelled |
3 | 4 | Ordered |
Desired outcome:
ID | QTY |
1 | 7 |
2 | 2 |
3 | 4 |
I am tyring with the DAX but still fail. Appreciated if you have any idea. Thanks
_Table =
ADDCOLUMNS(
SUMMARIZE(FILTER('Table','Table'[Status]="Ordered"),'Table'[ID]),
"SUM", CALCULATE(SUM('Table'[QTY])))
Solved! Go to Solution.
Try
_Table =
SUMMARIZE(FILTER('Table','Table'[Status]="Ordered"),'Table'[ID],
"SUM", CALCULATE(SUM('Table'[QTY])))
Proud to be a Super User!
Try
_Table =
SUMMARIZE(FILTER('Table','Table'[Status]="Ordered"),'Table'[ID],
"SUM", CALCULATE(SUM('Table'[QTY])))
Proud to be a Super User!
@FarhanAhmed you solution works very fine. May I know how it is possible that your solution can still work without ADDCOLUMN?
Great thanks anyways
Hi,
Please try the below for creating a new table.
_Table =
VAR filteredtable =
FILTER ( 'Table', 'Table'[Status] = "Ordered" )
VAR newtable =
SUMMARIZE ( filteredtable, 'Table'[ID], 'Table'[QTY] )
RETURN
newtable
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
User | Count |
---|---|
98 | |
90 | |
84 | |
71 | |
67 |
User | Count |
---|---|
114 | |
103 | |
100 | |
72 | |
64 |