Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi everybody
I am using the following measure to add the result of the calculation of a measure in several non-consecutive months:
SUMX(Dates,'Measures'[Measure])
This works perfectly. For example, when selecting 3 non-consecutive months ('01-01-2022', '02-01-2022',
05-01-2022) is adding the results given by the measure for each month.
But now I need it to show me the same sum, but for the equivalent of the months 1 year ago or 2 years ago.
For example, if I select ('01-01-2022', '02-01-2022','05-01-2022'), I would like you to add the result of the measurement calculated for '01-01-2021', '02-01-2021','05-01-2021'. For that I am using this measure:
SUMX(FILTER(Date,Date[Date]=EDATE((Date[Date]),-12)),'Measures'[Measure])
The problem with using functions like dateadd or parallelperiod is that they don't work with non-consecutive dates.
I would be very grateful to anyone who could help me.
LJ.
Solved! Go to Solution.
Try this measure:
Last Year =
CALCULATE ( SUM ( FactTable[Amount] ), SAMEPERIODLASTYEAR ( Dates[Date] ) )
The slicer and table visual use Dates columns:
Data:
Proud to be a Super User!
Try this measure:
Last Year =
CALCULATE ( SUM ( FactTable[Amount] ), SAMEPERIODLASTYEAR ( Dates[Date] ) )
The slicer and table visual use Dates columns:
Data:
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
142 | |
71 | |
64 | |
52 | |
50 |
User | Count |
---|---|
208 | |
91 | |
62 | |
59 | |
56 |