Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm trying to create a visualisation that goes back 12 months from the selected date in a slicer.
I'm working off this video - https://www.youtube.com/watch?v=d8Rm7dwM6gc
My Code so far is:
TRI P12M =
VAR ReferenceDate = MAX ( 'Date'[Date] )
VAR PreviousDates =
DATESINPERIOD (
'Previous Date'[Date],
ReferenceDate,
-12,
MONTH
)
VAR Result =
CALCULATE(
MAX(
'DataFreqRates'[TRI Month]),
PreviousDates,
USERELATIONSHIP ( 'Date'[Date], 'Previous Date'[Date])
)
RETURN
Result
I can follow what the video is saying and what it is trying to do, but I am getting an error - MdxScript(Model) (18, 5) Calculation error in measure 'DataFreqRates'[TRI P12M]: an invalid numeric representation of a date value was encountered.
Which I think is saying I am trying to sum a date, but I'm not sure how or why.
Suspect its cause I'm only new to DAX and am missing something basic.
More Info -
TRI Month is basically a performance metric for the end of the month.
DataFreqRates is the table that calculates several scores.
Can someone point me in the right direction?
User | Count |
---|---|
23 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |