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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
116 | |
106 | |
94 | |
79 | |
72 |