Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I would like to calculate a subtotal using dax (not using the subtotal feature of matrix visual)
Sample data:
Client | Shop | Sales |
A | 1 | 100 |
A | 2 | 200 |
B | 3 | 400 |
B | 4 | 500 |
Desired outcome:
I want a measure that can calculate Client total for the displayed Shop without adding the client field itself to the visual
Shop | Client Total |
1 | 300 |
2 | 300 |
3 | 900 |
4 | 900 |
Best I could come up with was
CALCULATE(SUM('Table1'[Sales]); ALL('Table1'[Shop]))
but it just gives me a repeating 1200 across all shops as it should unless I add client field to the table.
How can I add filter context for the client into the measure if its not part of a visual?
Solved! Go to Solution.
@Credo Please try this as a "New Measure"
Test107 = CALCULATE(SUM(Test107Measure[Sales]),FILTER(ALL(Test107Measure),Test107Measure[Client]=SELECTEDVALUE(Test107Measure[Client])))
Proud to be a PBI Community Champion
Add as measure
TotVal = CALCULATE(SUM(Table1[Sales]),ALLEXCEPT(Table1,Table1[Client]))
@Credo Please try this as a "New Measure"
Test107 = CALCULATE(SUM(Test107Measure[Sales]),FILTER(ALL(Test107Measure),Test107Measure[Client]=SELECTEDVALUE(Test107Measure[Client])))
Proud to be a PBI Community Champion
Thanks a lot
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
72 | |
68 | |
41 | |
35 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |