cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors