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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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