cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yosinator
Frequent Visitor

Any idea why this calculation is not resulting in any values?

Yosinator_0-1668105021901.png

 

It's a combination of an if and switch statement. Wondering if I made any errors anywhere.. 

 

1 ACCEPTED SOLUTION

@Yosinator I see the issue!! You are subtracting 2022-1-31 or resulting in 1990 (the number 1990 which is 1990 days away from the base DAX date of 12/30/1899. You need to do that like DATE(2022,1,31)


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Yosinator Just make it 1 SWITCH statement and include your [Course] as another &&


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

Hey Greg, I gave that a shot and it still didn't yield any values. 

Strange. 

@Yosinator I see the issue!! You are subtracting 2022-1-31 or resulting in 1990 (the number 1990 which is 1990 days away from the base DAX date of 12/30/1899. You need to do that like DATE(2022,1,31)


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.