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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
SevsBo
Resolver I
Resolver I

DatesYTD not working on calculated Calendar table

The longer tail of this question is that I am trying to create a YTD this year vs YTD last year comparison, so I am following instructions on how to build that. One of the requirements is to have a Calendar table that can be used as the basis for filtering MainTable, if we call it that, but when testing the Measure just for this year TYD I already hit a problem.

 

The Calendar table has an active relationship to MainTable and if I add a time slicer to the page, I can use Calendar date to filter results from MainTable, or I can use a Filter on this visual/page to filter the date, so the relationship works. But this relationship appears to stop working in the Measure.

 

I have already checked the data in Query Editor for MainData - the Date column is set to Date. I have also used "Mark as date table" on the calculated Calendar table.

 

My test measures, for this year YTD, are:

 

Measure1 = 

CALCULATE(COUNTROWS(MainTable), MainTable[Codition1] = "one", MainTable[Codition2] = "two", MainTable[Codition2] = "three", DATESYTD(MainTable[Date]))
 

Measure2 = 

CALCULATE(COUNTROWS(MainTable), MainTable[Codition1] = "one", MainTable[Codition2] = "two", MainTable[Codition2] = "three", DATESYTD(Calendar[Date]))
 
Measure1 works perfectly while Measure2 shows BLANK as the result.
 
Any advice on how to resolve this?
3 REPLIES 3
v-zhangtin-msft
Community Support
Community Support

Hi, @SevsBo 

 

I reverted your problem but my measure2 is working fine, please check the attachment.

vzhangtinmsft_0-1728540659505.png

Can you provide some of the example data? Please remove any sensitive data in advance.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SevsBo
Resolver I
Resolver I

Hi @dharmendars007 

As stated in the original question, there is an active relationship, and the Calendar table does work as a filter outside the measure. Is there an issue with the measure?

dharmendars007
Super User
Super User

Hello @SevsBo , 

 

Kindly check if your Calendar table and Main Table is connected with one-to-many relationship and it is active.

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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