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
edozzy
New Member

New to Power BI and stuck trying to create date measures

Hello, I'm a complete Power BI newbie and trying to get my head round some of the features and some simple functions. I've managed to set up initial data source table and run create some initial visualisations on the data in the table, but now I'd like to take next step and do some more analysis relating to dates. 

 

In my initial table called "Live Campaign List" I have two date fields: 

- Date Started Planning 

- Date Sent to Current Position 

 

I'm trying to create measures using the DATEDIFF function to calculate:

  • Power bi date difference (in days or months) between the two columns
  • Power bi date difference from today (again in days or months) 

This is probably too advanced for me, given I can't master the basic functions, but ultimately I think it would be good to determine a categorisation of risk - Red/Amber/Green based on length of time difference (ie those with longer time gap and priority level of campaign).

 

I have tried to use a DAX calcuation as follows:

 

Date Difference Interval Measure = DATEDIFF('Live Campaigns List'[Date Started Planning], 'Live Campaigns List'[Date Sent to Current Position], Day)
but I get an error message saying that in the "Date Started Planning" a single value cannot be determined. 
 
What am I doing wrong? How do I get the calculations to work?
 
Thanks in advance
 
Ed
1 REPLY 1
AnthonyGenovese
Resolver III
Resolver III

You need to create this as a calculated column. It will not work as a measure, as is. 

 

If this post was helpful, please kudos or accept the answer as a solution.
~ Anthony Genovese
Need more PBI help? PM me for affordable, dedicated training or consultant recomendations!

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.

Top Solution Authors