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
VinnyH
Frequent Visitor

Flag when date threshold has been reached

Hello,

 

I'm trying to create a dynamic report to show customer revenue data over a period of 6 months that will be automatically updated moving forward. I would like to show when a customer hasn't traded with us for a three month period and for this to be automatically flagged in the report. 

 

I've seen messages about using a measure to flag when a value threshold is reached on other threads, but cannot work this out when it comes to dynamic date ranges.

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
edhans
Super User
Super User

This will calculate how many days since the last sale happened. This assumes a Date table is set up.

 

Days Since Last Sale = 
CALCULATE(
    DATEDIFF(MAX(Sales[Date]),TODAY(),DAY),
    ALL('Date'[Date])
)

It assumes your fiter context in the table has customers in it. In my sample data, the last sale for Customer 6 was May 15, 2019, so that was 93 days ago. You could then do whatever you want when that hits 90+ days.

20190815 07_37_48-Untitled - Power BI Desktop.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Super User
Super User

This will calculate how many days since the last sale happened. This assumes a Date table is set up.

 

Days Since Last Sale = 
CALCULATE(
    DATEDIFF(MAX(Sales[Date]),TODAY(),DAY),
    ALL('Date'[Date])
)

It assumes your fiter context in the table has customers in it. In my sample data, the last sale for Customer 6 was May 15, 2019, so that was 93 days ago. You could then do whatever you want when that hits 90+ days.

20190815 07_37_48-Untitled - Power BI Desktop.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
VinnyH
Frequent Visitor

That's absolutely fantastic, thank you. I would've been here forever trying to work that out!

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.