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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
sid-agarwal
Frequent Visitor

PowerBI Datediff

sidagarwal_0-1740583748052.png


I am trying to create data card on PBI report which shows the average time (in days) it takes to get the approval from the time the entry was created, which approval1Date Minus (-) the CreatedDate.
I tried using the datediff fuction but it is not pulling the date column for some reason.

 

1 ACCEPTED SOLUTION
ahmedoye
Responsive Resident
Responsive Resident

Because you are creating this as a Measure and not as a Calculated Column, you may not get the right behavior.

What you probably want to do is to create the formula as a calculated column, or use a Measure that is like:

AVERAGEX(YourTable, DATEDIFF(YourTableColumn1, YourTableColumn2, DAY))

If this works for you, kindly mark as answer to make it easier for anyone with similar issues to find the solution.

View solution in original post

3 REPLIES 3
sid-agarwal
Frequent Visitor

@ahmedoye 
Hi,
your solution was working fine until today but suddenly the visual broke and gave me this error. Can you think of something what could have done that?

(I created a new date table [foolwing another query about PBI] https://community.fabric.microsoft.com/t5/Desktop/Custom-Date-drop-down-slicer/m-p/4591075#M1377166)
and created a relationship between the "CREATED" column in my main tables and DATE Table. Did nothing to the visual that broke. 


sidagarwal_0-1741011488696.png

 

Hi @sid-agarwal , from what I see here, you just need to remove the parts in the formula that have ".date". Those undelines and you will be fine.

ahmedoye
Responsive Resident
Responsive Resident

Because you are creating this as a Measure and not as a Calculated Column, you may not get the right behavior.

What you probably want to do is to create the formula as a calculated column, or use a Measure that is like:

AVERAGEX(YourTable, DATEDIFF(YourTableColumn1, YourTableColumn2, DAY))

If this works for you, kindly mark as answer to make it easier for anyone with similar issues to find the solution.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.