Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I'm using Power Bi Desktop Report Server version from may 2022.
I'm trying to use DATEDIFF function to calculate days between two dates. Unfortunately when I want to use as argument a date from a data table I can only see measures. I was trying to add a calculated column in fact tabel and all went well. The "datediff" function acted correctly but I see I cannot use this solution in my report becouse refreshing data lasts too long. So I need to create a measure but I don't know where is a problem.
If somebody has an idea what can be wrong in my model I would be very grateful for help 🙂
Best regards,
Andrew
Solved! Go to Solution.
Hi, @EndriuBlack ,
For measures, there's not row context. So you cannot use directly the columns, you need to aggreagate your data so some aggregation fucntion such as MAX. IF you wrap it to MAX, then you can use the column.
Since measures are calculated only based on current filter context, you don't have access to rows context.
You can also use X function to retrieve that row context and access the rows (MAXX).
Hi, @EndriuBlack ,
For measures, there's not row context. So you cannot use directly the columns, you need to aggreagate your data so some aggregation fucntion such as MAX. IF you wrap it to MAX, then you can use the column.
Since measures are calculated only based on current filter context, you don't have access to rows context.
You can also use X function to retrieve that row context and access the rows (MAXX).
Thank You !
Now I understand it. I have used MAX function for both dates and the measure works. I see that calculating last very long so I cannot use this parameter in my report but now I know more for the future 😉
Best Regards,
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.