Forum Discussion
DAX: sum with filters
- 10 years ago
Following DAX measure should work for you:
Result = CALCULATE(SUM('Pos'[Value]),ALL('Pos'[Isin Code]),'Pos'[N.Por]=77)
Check out the Chicagoland Power BI User Group
- larabraghetti10 years ago
Helper II
Hi Nikil,
thanks for your answer but I still have the same issue... I see the Result only for lines with portfolio 77 and not for the others ptf.
Regards
Lara- kcantor10 years ago
Community Champion
Use just a simple SUM as in =SUM('Pos'[Value]). then apply the filters by portfolio either to the visual or as a slicer. For example, use the portfolio as the rows in a matrix with the sum to the side. This will use the calculation and apply it across all porfolios. You can also use the portfolio as an axis.
By wrapping the sum in a calculate and specifing portfolio 77, you are having the calculation ignore all other portfolios. That is fine if you only want to use the one portfolio but if you want others you need to let the slicers work for you. Otherwise you have to create a calculation for each portfolio and use them individually.
- larabraghetti10 years ago
Helper II
Hi Kcantor,
I don't know if I well undestood but for the others portfolios (different to 77) I'd like to have the sum of values of the portfolio 77 (for each Isin Code).
I don't know if with your solution I will have the desidered result.
I will try and I will give you a feedback.
Thank you
Lara