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
Gopal_PV
Helper I
Helper I

How to Show Delta Between TODAY() and Modified Date formatted as Days in Dax

Hi Friends,

I have requirement to how Delta Between TODAY() and Modified Date formatted as Days  in the Card in the report.

And i want a slicer to select below as 

Input Number of Days Since Modified” as a drop-down selection that buckets day thresholds as follows:

 

  • < 30 Days
  • > 30 Days and < 60 Days
  • > 60 Days and < 90 Days
  • > 90 Days

Can you please help me  how to create dax measures or columns.

1 ACCEPTED SOLUTION

hi @Gopal_PV ,

 

not sure if i get you, supposing you have a data table like:

Date
8/1/2023
9/1/2023
10/1/2023
11/1/2023
12/1/2023
12/2/2023
12/3/2023

 

try to add a calculated column like:

Column = 
VAR _diff = DATEDIFF([date], TODAY(), DAY)
VAR _result =
SWITCH(
    TRUE(),
    _diff>90, ">90 days",
    _diff>60, "> 60 Days and <= 90 Days",
    _diff>30, "> 30 Days and <= 60 Days",
    "<=30 days"
)
RETURN _result

 

it worked like:

FreemanZ_0-1701874022430.png

 

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi @lbendlin 

Thank you for your reply. I am sharing below sample data

 

Modifiedon Today
11-06-2023 
11-07-2023 
11-08-2023 
11-09-2023 
11-10-2023 
11-11-2023 
11-12-2023 

hi @Gopal_PV ,

 

not sure if i get you, supposing you have a data table like:

Date
8/1/2023
9/1/2023
10/1/2023
11/1/2023
12/1/2023
12/2/2023
12/3/2023

 

try to add a calculated column like:

Column = 
VAR _diff = DATEDIFF([date], TODAY(), DAY)
VAR _result =
SWITCH(
    TRUE(),
    _diff>90, ">90 days",
    _diff>60, "> 60 Days and <= 90 Days",
    _diff>30, "> 30 Days and <= 60 Days",
    "<=30 days"
)
RETURN _result

 

it worked like:

FreemanZ_0-1701874022430.png

 

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.

Top Solution Authors