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

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.

Reply
kcantor
Community Champion
Community Champion

Calculate a Date Difference

I am trying to calculate a difference in an order date and a conversion date. These dates are pulled from different tables into a single matrix. Generally, BI offers suggestions to help gather data but this time, BI is strangely quiet. My attempted DAX is similar to "Days to Convert = DateDiff('Table1'[Orderdate], 'Table2'[DateConverted, DAY)" any assistance is greatly appreciated. I am still fairly new to DAX in BI.

If necessary, I do have a DimDate table to use.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




6 REPLIES 6
antonny999
New Member

Hi 

Currently i use direct query on my server database, which i have a date field that currently already at the DATE format.

which is the format is (dddd, MMMM dd, yyyy)

Sample Power BI.jpg

 

the detail data have different date but in the same month, i dont know why the display between axis and value is not above the X axis.

 

i think its because the data have different date. 

can you tell me how to fixed it?

 

thank you for your support

kcantor
Community Champion
Community Champion

Well, yes and no. there are other questions regarding the same DAX. What I was not as clear about as I intended to be is the fact that when I am trying to enter the measure, BI isn't recognizing my table references. Even when I key them in, it will not pull the information but it also doesn't offer any help as far as suggestions for table names or columns through autofil.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ah, I understand now. Yeah, I see the same odd behavoir. On some calculations (Sum, AVERAGE) etc, the autofill works, and in other cases it isn't... odd


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Old thread I know, and there doesn't seem to be an update? 

 

I am coming across the same issue, where PBI doesn't seem to allow me to use different table references for each value.  Even when I write them in myself, it doesn't seem to recognise them at all? 

 

Is this a limiation of PBI?

Actually I tried combining datediff with related, and it seems to work, try something like:

 

Days to Convert = DateDiff('Table1'[Orderdate], related('Table2'[DateConverted), DAY)"

 

See how that goes?

@kcantor I believe you are asking the same as a couple other threads already have...

see here


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.