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
en-j
Frequent Visitor

Card showing "Blank" when using Date table

Hallo

I have two tables

  • Orders which contains sale orders' amounts and dates along with a datekey (yyyyMMdd)
  • Calendar with dates ranging beyond the sale orders' dates, with a corresponding datekey column; no missing date values in the interval.
  • They have an active relationship, 1:* Calendar > Orders

I added a YTD measure to the Orders:

Orders YTD = TOTALYTD( SUM(Orders[Amount]) ; Calendar[Date] );

When I use it within a Card visual, I get a "(Blank)" value 

Everything shows ok If I swap the Calendar[Date] with a Orders[Date], like this:

Orders YTD = TOTALYTD( SUM(Orders[Amount]) ; Orders[Date] );

What am I missing?
Thanks in advance

 

1 ACCEPTED SOLUTION
TheOckieMofo
Resolver II
Resolver II

The issue is likely that you need to tell PBI what year it is, either by using a page/report level filter in PBI or a slicer in the report itself. The time-intelligence functions in DAX will default to the max year in your dates table if you do not tell PBI what year it is. Therefore, if you have the calendar table that goes out to 2018, the measure will show blank unless you tell PBI that the year is 2017.

 

Here's a little extra two cents, but I always prefer to have a trimmed calendar table. What I mean is, you can trim your calendar to not have dates that go beyond the max value you have in your sales fact table.

View solution in original post

2 REPLIES 2
TheOckieMofo
Resolver II
Resolver II

The issue is likely that you need to tell PBI what year it is, either by using a page/report level filter in PBI or a slicer in the report itself. The time-intelligence functions in DAX will default to the max year in your dates table if you do not tell PBI what year it is. Therefore, if you have the calendar table that goes out to 2018, the measure will show blank unless you tell PBI that the year is 2017.

 

Here's a little extra two cents, but I always prefer to have a trimmed calendar table. What I mean is, you can trim your calendar to not have dates that go beyond the max value you have in your sales fact table.

Greg_Deckler
Community Champion
Community Champion

Hmm, perhaps add an additional parameter to TOTALYTD or ALL(Calendar):

https://msdn.microsoft.com/en-us/library/ee634400.aspx

 



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.