Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
Using PBID (March, 2024)
I created a measure to get max date from a column - works as expected
I added a calculated column to compare the measure to the order date in each row - but this is returning zero
Days From Max Date =
DATEDIFF( Data[Date], [Max Date], DAY )
What am I doing wrong?
Thanks,
-w
Thanks @amitchandak
I need a calculated column. My end goal is to have something I can filter for <= 6 (0 - 6) Or the most recent 7 days. Today function seems to be problematic when refreshing in the Service not returning expected results due to time zones etc....
Thanks,
-w
Hi @tecumseh ,
I create a table as you mentioned.
Then I create a calculated column named MaxDate.
MaxDate = MAX('Table'[Date])
Also I create another calculated column.
Column = DATEDIFF('Table'[Date],'Table'[MaxDate],DAY)
I think the reason you're getting 0 should be that you're using Measure when calculating the max dates, so it's returning the maximum value for each row of dates, which is going to give you 0 when subtracted, but you can avoid that if you use a calculated column.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@tecumseh , if you are trying to create a column when Max Date is Measure. You can not use a measure or slicer value in a column
Create a measure like
Averagex(data,DATEDIFF( Data[Date], [Max Date], DAY ))
User | Count |
---|---|
80 | |
76 | |
70 | |
69 | |
54 |
User | Count |
---|---|
104 | |
99 | |
92 | |
78 | |
69 |