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.
Help..
I have column named "Driver_Card_Expiry_Date". I tried to use New Measure.
Months Left = DATEDIFF ([Today Date], ________________, MONTH)
The column I want won't appear. Please help tp solve. I've been at it for half a day.
Thanks.
Solved! Go to Solution.
You can't use the column as a reference in measure since measure expects and returns a single value.
Use LASTDATE() DAX function. it will take last non-blank date and calculate month difference.
E.g,
Months Left = DATEDIFF ([Today Date], LASTDATE(Driver_Card_Expiry_Date), MONTH)
Thanks Siva,
It took me my whole morning to learn about that. I just found the 5 golden rules for DAX Measures, and no.2 is No Naked Column.
I understood that and use the Calculated Columns instead. And voilaa..! It works.
MONTHS LEFT = DATEDIFF(TODAY(), DRIVER[Date Expire].[Date], MONTH)
Thanks for your input Siva !
You can't use the column as a reference in measure since measure expects and returns a single value.
Use LASTDATE() DAX function. it will take last non-blank date and calculate month difference.
E.g,
Months Left = DATEDIFF ([Today Date], LASTDATE(Driver_Card_Expiry_Date), MONTH)
Thanks Siva,
It took me my whole morning to learn about that. I just found the 5 golden rules for DAX Measures, and no.2 is No Naked Column.
I understood that and use the Calculated Columns instead. And voilaa..! It works.
MONTHS LEFT = DATEDIFF(TODAY(), DRIVER[Date Expire].[Date], MONTH)
Thanks for your input Siva !
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 |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |