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
Applicable88
Impactful Individual
Impactful Individual

If next day from now time is a prodcutive day then flag 1 else 0

Hello,


I have a mastercalendar with all dates and a flag 1 or 0 , for each day if its a productive day or not.

Monday til friday the flag is 1, Saturday and Sunday its 0. 

 

That mastercalendar is connected to a factable column called NOWTIME where I simply pull the now UTC time as date :

NOWTIMEUTC].[Date]

 

I now want to make a additional calculated column to check if the next day is a productive day whenever I make Dataset refresh:

 

CheckIFNextDayISProductive=

IF( Related(Mastercalendar[Date]) = NEXTDAY(Facttable[NOWTIMEUTC].[Date])  && Related(Mastercalendar[ProduductiveDay]) = 1, 1, 0)

 

I always get 0, so there is something wrong with the syntax I guess.

Thank you very much in advance.

Best. 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Applicable88 

please try

CheckIFNextDayISProductive =
IF (
    RELATED ( Mastercalendar[Date] ) = Facttable[NOWTIMEUTC].[Date] + 1
        && RELATED ( Mastercalendar[ProduductiveDay] ) = 1,
    1,
    0
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @Applicable88 

please try

CheckIFNextDayISProductive =
IF (
    RELATED ( Mastercalendar[Date] ) = Facttable[NOWTIMEUTC].[Date] + 1
        && RELATED ( Mastercalendar[ProduductiveDay] ) = 1,
    1,
    0
)
YukiK
Impactful Individual
Impactful Individual

I don't think that's how you're supposed to use nextday function. If you wanna compare a date and the next day, you can use the date function like in the following:

 

The next day = DATE(YEAR(YOURDATE), MONTH(YOURDATE), DAY(YOURDATE)+1)

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!

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.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.