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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
scarlet61980
Regular Visitor

Date Table Not Working

Hello,  I started using PowerBI desktop a couple of months ago. It is set up for direct query and I have an appended query with a date which is single direction related to a Date Table.  It will not properly calculate prior YTD and current YTD sales totals using the DAX langauge as below:

 

YTD Sales = TOTALYTD(
        SUM('2022-2023 Health System Sales'[HS Sales Value]),'Date Table'[End of Month])
 
Prior YTD Sales = CALCULATE([YTD Sales],SAMEPERIODLASTYEAR('Date Table'[End of Month]))
 

I have already checked that the edit query language shows the date field as date and it shows as date type as well.

 

Is this b/c I'm using Direct Query? I have not done much with calculate/DAX in general other than creating measures up to this point but I feel like this shoudl be fairly simple.

 

scarlet61980_1-1700585707687.png

 

4 REPLIES 4
scarlet61980
Regular Visitor

It is a date column in a date table I created that runs for several years starting with 1/1/2022. 

 

I have a table with sales from 1/1/2022-8/31/2023, I update it monthly.  I am trying to do a matrix visual that shows various time intelligent totals such as rolling 12 months sales, prior YTD and a variance of prior YTD vs Current YTD ultimately.  I have started with Prior YTD and it gives me the below in the visual which is the entire prior year (2022), expecting 1/1/2022-8/31/2022 as that is the latest date in the HS Sales Date column of the 2022-2023 Health Systems table I had in my original post (which is the column I have related to the Day in the Date Table).  

 

scarlet61980_0-1700602334264.png

 

YTD Sales Formula as I originally did it:

scarlet61980_1-1700602424005.png

Prior YTD:

scarlet61980_2-1700602440551.png

 

parry2k
Super User
Super User

@scarlet61980 day is a date column? Weird name though if that is the case. Based on the expression it should work. When you say not working, what does it mean? Wrong value, error? How do you display the measure in the visual?

 

It is not easy to answer the question based on vague reply, if you provide more details it will be helpful. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

scarlet61980
Regular Visitor

I had tried the "Day" also intially but that did not work either.

parry2k
Super User
Super User

@scarlet61980 instead of using End of Month column it should be date column from the date dimension. I have full playlist on time intelligence you can check it here. 


Time Intelligence Playlist

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.