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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
pankajdhillon
Frequent Visitor

TOTALYTD not working

I am using TOTALYTD but no output is coming from it

TOTALYTD(COUNT(BookingDataAir[Bookings]),'DimDate'[full_date])

 

whereas when I use CALCULATE it works fine and gives expected result

CALCULATE(COUNT(BookingDataAir[Bookings]),'DimDate'[full_date])

1 ACCEPTED SOLUTION
pankajdhillon
Frequent Visitor

Actually I realized my mistake, my formula was correct but when I was trying to visualize my data I was using date column from my BookingDataAir dataset rather than using them from DimDate dataset and due to that no value was coming for TOTALYTD. 

 

Thanks everyone for help though.

 

View solution in original post

8 REPLIES 8
pankajdhillon
Frequent Visitor

Actually I realized my mistake, my formula was correct but when I was trying to visualize my data I was using date column from my BookingDataAir dataset rather than using them from DimDate dataset and due to that no value was coming for TOTALYTD. 

 

Thanks everyone for help though.

 

DAX is all about context! 🙂



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...
fbrossard
Kudo Commander
Kudo Commander

Hi @pankajdhillon

 

Do you use PBI Desktop as designer ?

If yes, you should know that in PBI Dekstop you can't mark table as date. To use time functions you should define you relationships between factTables/DimDate by using a date or dateime column.

Thus your TOTALYTD will work.

Greg_Deckler
Community Champion
Community Champion

What if you use:

TOTALYTD(COUNT(BookingDataAir[Bookings]),'DimDate'​[full_date],ALL('DimDate'))


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...

Even that works same as TOTALYTD(COUNT(BookingDataAir[Bookings]),'DimDate'​[full_date]) i.e. no output 😞

What is the context in which you are using that measure?



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...
Anonymous
Not applicable

Question, what are your beginning year dates?  1/1/xx or 12/31/xx

 

Depending what you are trying to acheive, what I do is that I always want a current YTD kpi on my dashboard.  So I just utilize two different Measures.

1. Current Count: COUNT(xxxx)

2. Beginning of year count: OPENINGBALANCEYEAR(xxxx)

3.  Take 1 mins 2 and

 

This also assumes your data is accumulative in nature. 

Even OPENINGBALANCEYEAR(COUNT(BookingDataAir[Bookings]),DimDate[full_date]) is giving me no result.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.