The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have the following code - however it pulling back the previous twelves months from example the 20th July 2021. I am wanting to bring back everything from every month in the 12 month list - how could I go about that?
Also - it bring values back - however if i put it in a matrix with month name it is pulling back the same figure for every month..why is that and what is the way round that?
TIA
No of Referrals =
CALCULATE(
count(Referrals[UniqueRef]),
DATESINPERIOD( 'Calendar'[Date], today() , -12, MONTH )
)
Solved! Go to Solution.
@Anonymous , This will rollup 12 months for each date based on today
rolling 12 for each date
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))
Display 12 month when date is not filtered
Rolling 12 Sales =
var _max = maxx(allselected(date),date[date]) // or today()
var _min = date(year(_max), month(_max)-12,1)
return
CALCULATE(SUM(Sales[Sales Amount]),filter(date, date[date] <=_max && date[date] >=_min))
If you select one date and want to show 12 month trend
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
@Anonymous , This will rollup 12 months for each date based on today
rolling 12 for each date
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))
Display 12 month when date is not filtered
Rolling 12 Sales =
var _max = maxx(allselected(date),date[date]) // or today()
var _min = date(year(_max), month(_max)-12,1)
return
CALCULATE(SUM(Sales[Sales Amount]),filter(date, date[date] <=_max && date[date] >=_min))
If you select one date and want to show 12 month trend
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
User | Count |
---|---|
77 | |
75 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
81 | |
57 | |
48 | |
48 |