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
Hi, I would create a visualization to compare performances over time so I created a calculated measurement
TotalSpent_PY =
CALCULATE (
[Total Spent],
OFFSET (
-1,
ALLSELECTED ( Data[YEAR] ),
ORDERBY ( Data[YEAR], ASC )
)
)
And this is the result:
The problem is that I would focus my view on a specific year (and the previous one), in that case using slicer I got this:
The only way to have it working is selecting two years and I would avoid it because users can select more than 2 years.
The final objective is getting something like:
I've tried several way (including a measurement like
CALCULATE (SUM(), SAMEPERIODLASTYEAR)
But It is the same.
The only solution I have in mind is to create a pre-built filter with years combination (more complicated to be managed), but I don't know how to do it, someone colud help?
Thanks
Solved! Go to Solution.
Hi,
I am not sure how your Calendar table is configured, but please try using ALL DAX function in the measure, instead of using ALLSELECTED DAX function.
Hi,
I am not sure how your Calendar table is configured, but please try using ALL DAX function in the measure, instead of using ALLSELECTED DAX function.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |