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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

True/False measure for "Is this ISO year" & "Is this ISO week"

Hi all,

 

I need some help with a dax formula which combines two true/false measures.

 

Variables:

Is This ISO_Year = IF(VALUE(Calender[ISO_Year]) = VALUE(YEAR(TODAY())), True, False)

True if the selected date value is in the current ISO year. Else False.

 

Is before This Week = IF(VALUE(Calender[ISO_WeekNumber]) < VALUE(Calender[Current ISO_Weeknumber]), True, False)

True if the selected date value is before this week. Else False.

Results for those combined below (current date 23-7-2020 = week 30; translation: waar=true, onwaar=false)

Stanneman_0-1595505761383.png

 

Now I'm struggling combining these two variables. I would like to create the value "Is this week & ISO year".

 

In other words: 

IF:

Current ISO year = true

Before this week = false

THEN:

True

ELSE:

False

 

I've tried nesting the above formulas, but I haven't succeeded yet. Can anyone help me out?

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@Anonymous - Should be:

 

Column = IF([Current ISO Year] && NOT([Before this week]),TRUE(),FALSE())

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Pragati11
Super User
Super User

Hi @Anonymous ,

 

Try creating a calculated column as follows:

IF ([Is This ISO_Year] = TRUE() && [Is before This Week] = FALSE(), TRUE(), FALSE())

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thanks for the very quick responses! Both solutions work great!

 

I was making it way to complicated with nesting both individual If-fomulas. I'm kind of wondering though what I should have done to make it work with a nested if construction. I felt like I was close, but in the end I kept getting errors.

HI @Anonymous ,

 

Sometimes that happens when we overcomplicate DAX after working for a long time on it.

But there is always an easier way of writing them 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Pragati11
Super User
Super User

Hi @Anonymous ,

 

Try creating a calculated column as follows:

IF ([Is This ISO_Year] = TRUE() && [Is before This Week] = FALSE(), TRUE(), FALSE())

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Greg_Deckler
Super User
Super User

@Anonymous - Should be:

 

Column = IF([Current ISO Year] && NOT([Before this week]),TRUE(),FALSE())

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.