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
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
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.