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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
gree1502
Helper II
Helper II

Create a measurement based on date

Hi,

 

I have table with column "notification date". This column is not unique.

 

I need to create a measurement, where the difference between now() and notification date should be greater than 45 days.

 

I tried using DateDiff : NotificationDateDiff = (DATEDIFF(tablename[Notification Date],NOW(),DAY)) > 45

It gives me following error:

A single value for column 'Notification Date' in table 'tablename' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Can anyone help me with this?

 

Appreciate the help.

Thanks

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

You could try a couple things. One, put a MAX or other aggregator around your Notification Date in your formula. Or, you could put this formula into a calculated column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

You could try a couple things. One, put a MAX or other aggregator around your Notification Date in your formula. Or, you could put this formula into a calculated column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I found the solution.

 

Thank you.

Thanks for the response.

I don't understand the use of max here. I want to check each record, if the difference is > 45.

consider that date if > 45 else ignore.

 

Can you elaborate?

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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