Forum Discussion
Syndicate_Admin
4 years agoAdministrator
Dax
Good afternoon community, I would like to consult you how I could make a measurement in which it allows me to know the value of last year of the current month, also have a parameter of months which ...
Duia
4 years agoResolver II
Hi Syndicate_Admin ,
Here are the steps you can follow:
1. Modeling - New parameter - Create a 0-12 table as a slicer.
2. Create measure.
Measure =
var _select=SELECTEDVALUE('periodo'[periodo])
var _today=TODAY()
var _maxdate=MAXX(ALL('Table'),[Date])
return
IF(
YEAR(MAX('Table'[Date]))=YEAR(TODAY())&&
MAX('Table'[Date])<=DATE(YEAR(TODAY()),MONTH(_maxdate)-_select,1)
,
CALCULATE(SUM('Table'[valor]),FILTER(ALL('Table'),
'Table'[Date]=DATE(YEAR(MAX('Table'[Date]))-1,
MONTH(MAX('Table'[Date]))+_select,1)))
,BLANK())3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly