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
TimF
Frequent Visitor

Current Month calculated column - dax formula troubles

Hi there

 

i have tried using the following formula to create a calculated column reflecting a "yes" for those rows where [Date Reported] is that same month year.

 

Post_TempControls_CM =
if (YEAR ('MYOSH Incident Report'[Date Reported ]) = year (today ()) && MONTH ('MYOSH Incident Report'[Date Reported ] = month (today()) ), "Yes", "No" )
 
Unfortunately it returns "Yes" for rows where [Date Reported] is NOT the current month, in fact three different months. 
 
Cheers for any assistance.
 
Tim 
 
 
1 ACCEPTED SOLUTION
TimF
Frequent Visitor

i may have solved it...

 

Post_TempControls_CM =
if(YEAR(Today())=YEAR('MYOSH Incident Report'[Date Reported ]) && month(today())= month('MYOSH Incident Report'[Date Reported ]),"Yes","No")
 
welcome anyone explaining why this one now works over the original one however ?
 
Cheers
Tim 

View solution in original post

2 REPLIES 2
TimF
Frequent Visitor

i may have solved it...

 

Post_TempControls_CM =
if(YEAR(Today())=YEAR('MYOSH Incident Report'[Date Reported ]) && month(today())= month('MYOSH Incident Report'[Date Reported ]),"Yes","No")
 
welcome anyone explaining why this one now works over the original one however ?
 
Cheers
Tim 

It's a mystery, seems like you just swapped the order of the values you are comparing. Would need to see the data potentially to try to replicate but that doesn't make a whole lot of sense. 


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.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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