Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

calculate days between due date and today

hi

am having issues with a DAX measure, if i create it in PBI Desktop the measure works. If i create the DAX statement in Azure Analysis server and i refresh the data it is not giving issues so you might think it will work. FYI, the dataset i used in PBI desktop is the same as in AAS.

This is the DAX statement used: 

DaysDifference =
VAR DueDateFromDimensionalTable =
CALCULATE(
MAX('[Dim_DueDate]'[DateValue])
)
RETURN
DATEDIFF(TODAY(), DueDateFromDimensionalTable, DAY)

 

Once uploaded to PBI service it is not working: 

emveha_0-1689764642732.png

not sure what goes wrong and, even more important, how to solve this.

Hope someone can help....

thanks!!

3 REPLIES 3
Mahesh0016
Super User
Super User

@Anonymous Please try this, I hope this helps you!
DaysDifference =
VAR DueDateFromDimensionalTable =
MAX('[Dim_DueDate]'[DateValue])
RETURN
DATEDIFF(DueDateFromDimensionalTable,TODAY(),DAY)

Anonymous
Not applicable

Hi Mahesh,

 

have modified DAX, will have to wait till tomorrow.

Will let you know if it is okay or not.

In the meantime, thanks for your swift reponse, appreciate it!!!

Anonymous
Not applicable

hi Mahesh, 

as expected, the change did not work... sorry! This is the error message i receive when using the measure:

emveha_0-1689846167994.png

 

the weird thing is, in PBI Desktop (use exactly the same dataset) it is working properly (DAX Statement here was not changed to the specs from you)=

emveha_1-1689846252691.png

So, i added the DAX to the Azure Analytic Service cube and after Deployment to PBI service, it did not work anymore. Am confused.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.