Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Experts
Need a measure that give the last 12 months based on the selected date in Slicer.
Assume i select Mar 21 in the Slicer.
Then i want the measure to show Feb 20 - Mar 21 i want to use this in a title
If i Select Feb 21 from Slicer
Then i want the measure to show Jan 20 - Feb 21 and so on
Sample File
https://www.dropbox.com/s/bi1woiapsgx8p4v/v1.3.pbix?dl=0
Solved! Go to Solution.
@Anonymous , Sorry , Try like
New measure =
var _max = maxx(allselected('Date', 'Date'[date])
var _min = eomonth(_max,-12)
return
format(_min ,"mmm YY") & " to " & format(_max ,"mmm YY")
@Anonymous , Try like
New measure =
var _max = maxx(allselected('Date', 'Date'[date])
var _min = eomonth(_max,-12)
return
calculate(sum(Table[Value]), filter(all('Date'), 'Date'[date] >=Min && 'Date'[date] <=_max && Date[Date] <=max(Date[Date])))
or
One of the three
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH))
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-12,MONTH))
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))
Hi Amit.. How would that give me.... as a text string if i Select Mar 12 on Slicer ("Feb 20 to Mar 21")
@Anonymous , Sorry , Try like
New measure =
var _max = maxx(allselected('Date', 'Date'[date])
var _min = eomonth(_max,-12)
return
format(_min ,"mmm YY") & " to " & format(_max ,"mmm YY")
Thanks you sir.....Did you manage to look at the Tooltip one please.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
105 | |
88 | |
74 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |