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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
inglexjc
Helper IV
Helper IV

Show how many days till future due date

I need a new column or measure to show how many days till the "Next Appt Due".  My data has a lot of PPI so I'm providing an example.  Table name is V_TR_Dental_Medical.  I need to show how many days till the Next App Due for every client.

 

D_STF_PERS_NMECL_IDFRST_NMELST_NMEAPP_DTAPP_STATUSAPP_TYPAppt_sub_typeINITIAL_MEDICAL_DUETIMELY_VISITNEXT_APPT_DUE_DATE
Name1234NameName1/23/2023heldmed_followongoing1/26/2022y1/23/2014
2 ACCEPTED SOLUTIONS

@inglexjc ,
Just change the sequence of TODAY() and [NEXT_APPT_DUE_DATE].
So your new calculated would be below:

Days till next appt due = DATEDIFF(TODAY(), [NEXT_APPT_DUE_DATE], DAY)

 

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

View solution in original post

@inglexjc ,
You can directly conditionally format in the visualization.
Just in case you want a calculated column with negative numbers shown in red, here it is:

Color = IF([Days till next appt due] < 0, "#FF0000","#000000") 

 

You will need to conditionally format using this field.

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

View solution in original post

8 REPLIES 8
inglexjc
Helper IV
Helper IV

@anadad24  next part of this is I want to have the negative numbers (late date) to show in red.  I'm trying to create a measure to show a status of LATE.  Then I can create the conditional formating. Can you see what I'm doing wrong with my code?

 

Status =
VAR TodayDate = TODAY()
VAR NEXT_APPT_DUE_DATE = 'V_TR_Dental_Medical'[NEXT_APPT_DUE_DATE]
VAR Days till next appt due = TodayDate - NEXT_APPT_DUE_DATE
RETURN
IF(
Days till next appt due >= -1,
"Late")

 

inglexjc_1-1697817868342.png

 

 

 

@inglexjc ,
You can directly conditionally format in the visualization.
Just in case you want a calculated column with negative numbers shown in red, here it is:

Color = IF([Days till next appt due] < 0, "#FF0000","#000000") 

 

You will need to conditionally format using this field.

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

inglexjc
Helper IV
Helper IV

That did it.  Thank you!

Anand24
Super User
Super User

Hi @inglexjc ,
Create a new calculated column with below DAX:

Days till next appt due = DATEDIFF([NEXT_APPT_DUE_DATE], TODAY(),DAY)

 

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

@Anand24 it kind of worked.  Is there a way so the numbers aren't negative?

inglexjc_0-1697812909991.png

 

@inglexjc ,
Just change the sequence of TODAY() and [NEXT_APPT_DUE_DATE].
So your new calculated would be below:

Days till next appt due = DATEDIFF(TODAY(), [NEXT_APPT_DUE_DATE], DAY)

 

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

wrap the measure in an ABS() function 

inglexjc
Helper IV
Helper IV

@amitchandak  No one has responded to my question.  You are showing up as a top solution expert.  Would you happen to know?

Helpful resources

Announcements
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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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