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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Shelley
Continued Contributor
Continued Contributor

Why doesn't replacing TODAY() with an EOM calculation work?

I'm trying to assign a status to a contract, based on the start and end date of the contract. At first I was comparing it to TODAY(), but this is for a report/dashboard that is updated each month, with month-end data, so I wanted the status calculated based on the date of the latest order.

 

So, when I use this expression everything works as expected:

IF('srvc_contr'[contr_ln_itm_lifecyc_stat] = "Cancelled", "Cancelled",
IF(TODAY() >= srvc_contr[Contract End Date], "Complete",
IF(TODAY() < srvc_contr[Contract Start Date], "Future",
"Active")))
 
However, when I use a measure for the end of month, there are no contracts with an Active status. 
IF('srvc_contr'[contr_ln_itm_lifecyc_stat] = "Cancelled", "Cancelled",
IF([End of Current Reporting Month] >= srvc_contr[Contract End Date], "Complete",
IF([End of Current Reporting Month] < srvc_contr[Contract Start Date], "Future",
"Active")))
 
where: 
End of Current Reporting Month =
EOMONTH(MAX(OrdersView[Line_Creation_Date]), 0)
 
Why doesn't this work? Isn't this the same formula, except instead of TODAY, it's using 10/31/2019. What am I missing? Thanks for any help. Could this have anything to do with relationships? the Contracts are linked to the Calendar table by the Contract End Date. In the image below, you can see all of these contracts should have a status of "Active."
Annotation 2019-11-07 103324.png
1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Shelley 

I make a test as below, but i can't reproduce your priblem, could you show me more details, like:

the relationship between "srvc_contr" and "OrdersView" tables, " Calendar table" and "OrdersView" tables?

Capture4.JPG

Capture5.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.