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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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