cancel
Showing results for 
Search instead for 
Did you mean: 
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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors