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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
TornDigorn
Frequent Visitor

return 1 for different days of the week and different values

Hello dear community 

 

I need a help in creating column in DAX named "Old Cage" to return 1 for :

- column "days between" for values greater than 1 

- unless it is Monday then "days between" for values  greater than 2

 

Poniedzialek = (monday) 

 

Thanks so much in advance !

 

TornDigorn_0-1675589331011.png

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @TornDigorn 

try like:

Old Cage2 = 
IF(
    OR(
        [DayName] <> "Monday"&&[days between]>1,
        [DayName] = "Monday"&&[days between]>2
    ),
    1, 0
)

 

it worked like:

FreemanZ_0-1675591972653.png

 

View solution in original post

2 REPLIES 2
TornDigorn
Frequent Visitor

 

hello @FreemanZ 

that was it thank you very much ! 🙂 

FreemanZ
Super User
Super User

hi @TornDigorn 

try like:

Old Cage2 = 
IF(
    OR(
        [DayName] <> "Monday"&&[days between]>1,
        [DayName] = "Monday"&&[days between]>2
    ),
    1, 0
)

 

it worked like:

FreemanZ_0-1675591972653.png

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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