Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Dear all.
I have an issue with a DAX formula (I work with Power Pivot, not with Power BI). Problem ussing at the same time DATEADD + SUMMARIZE.
To be easier, I created a simple example with dates (only 2), families, products, quantity and totals.
What that I would like to calculate:
- A Pivot Table where selected 1 month, will appear this month and the previos one. With "Families" subtotal (see below).
- Calculate the difference due to Price variation (Price month - Price previous month) * Quantity previous month
- Calculate the difference due to Quantity variation (Quantity month - Quantity previous month) * Price month.
I would like to obtein a Pivot Table with the same information as in this one:
Problem with subtotal and totals in the Var. Q and Var. P.
I tried with SUMMARIZE, but does not work with DATEADD...
Thank you!
Best Regards,
Javier
Solved! Go to Solution.
@LEJ , Try add columns on top summzrize for such columns
example
measure =
Var _tab =
Addcolumns(SUMMARIZE(Table, Table[Product], Table[Month]) , "_1",[This Month], "_2", [Last Month] , "_3", [Last month Qty])
Return
Sumx(_tab, ([_1] -[_2])*[_3])
@LEJ , Try add columns on top summzrize for such columns
example
measure =
Var _tab =
Addcolumns(SUMMARIZE(Table, Table[Product], Table[Month]) , "_1",[This Month], "_2", [Last Month] , "_3", [Last month Qty])
Return
Sumx(_tab, ([_1] -[_2])*[_3])
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 13 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 25 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |