Forum Discussion
Help with ALLSELECTED by specific column summarized
I think there is a solve somewhere I am not thinking, but here is what I am trying to accomplish using the ALLSELECTED dax to summarize total sales -->
| Customer | Product | Sales | Total Sales |
| Drug Store | Candy Bars | 100 | 400 |
| Grocery Store | Candy Bars | 100 | 400 |
| Mass Merch | Gum | 100 | 400 |
| C-Store | Cookies | 100 | 400 |
Here is what I want, alway summarized dynamically by product -->
| Customer | Product | Sales | Total Sales |
| Drug Store | Candy Bars | 100 | 200 |
| Grocery Store | Candy Bars | 100 | 200 |
| Mass Merch | Gum | 100 | 100 |
| C-Store | Cookies | 100 | 100 |
I need it to be dynamic since other filters will routinely by applied (year, class of trade) but for that total sales column I need always at the parent product level. Is it possible withinnthe dax formula or do I need a new table?
Hi nj-matt ,
Try this:
Measuree = CALCULATE ( SUM ( CustomerProductSales[Sales] ), FILTER ( ALLSELECTED ( CustomerProductSales ), CustomerProductSales[Product] = SELECTEDVALUE ( CustomerProductSales[Product] ) ) )It helped? Mark it as an accepted solution.
Regards,
Loran
5 Replies
- MohammadLoran25Solution Sage
Hi nj-matt ,
Try this:
Measuree = CALCULATE ( SUM ( CustomerProductSales[Sales] ), FILTER ( ALLSELECTED ( CustomerProductSales ), CustomerProductSales[Product] = SELECTEDVALUE ( CustomerProductSales[Product] ) ) )It helped? Mark it as an accepted solution.
Regards,
Loran
- nj-mattHelper I
Success! Thanks so much, I knew it had to be something simple
- gch471218New Member
i want to filter the summarized table when i filter table2{2} by sliceer i.e. by choosing sent or received in the slicer i want my table to be filtered and updated below is the ocde
qty_sent_MonthlyAggregation =VAR currentwn = ALLSELECTED('Table2 (2)'[Sent])RETURNSUMMARIZE('Table2 (2)','Table2 (2)'[Company ],'Table2 (2)'[MonthName],"TotalQty", CALCULATE(SUM('Table2 (2)'[QTY]),FILTER('Table2 (2)','Table2 (2)'[Sent] IN currentwn)))- gch471218New Member
Hi can somebody please help