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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
calloni
Helper I
Helper I

DAX QTD not working (empty)

Hello

 

I used Bravo to generate some Time Intelligence metrics in Power BI DAX and it has worked great.

 

However when year changed to 2024 some calculations stopped working. I would like to focus on this:

 

QTD total_downloads =
IF (
    [_ShowValueForDates],
    CALCULATE (
        [total downloads],
        DATESQTD ( 'Calendar'[Date] )
    )
)
 
That one gives me blank. However a very similar YTD calculation does work:
 
YTD total_downloads =
IF (
    [_ShowValueForDates],
    CALCULATE (
        [total downloads],
        DATESYTD ( 'Calendar'[Date] )
    )
)
 
The data model basically has a Measures Table with [total downloads] which is the result of a very simple 
 
total downloads  = CALCULATE(SUM(DOWNLOADS[downloads]))
 
The DOWNLOADS table has a one to many relationship to the Calendar table.
 
What am I missing here?

Thanks in advance
Rodrigo
1 ACCEPTED SOLUTION

@calloni , The only reason I can think of that YTD is working and QTD is not working is that you do not have a date filter on the page, also visual is not using any period from Calendar. In such case, TD functions take the last date in the calendar. I am assuming your calendar is till year end and such case datesqtd will give the last qtr of the year and will not show data.

 

In such cases better default page with the current month or qtr( You can use relative date slicer for that)

 

Why DATESMTD is still blank, even after having correct TI Setup: https://youtu.be/j0ug-XQgZtg

Why previousmonth does not give result when datesmtd -1 1 month is giving it: https://youtu.be/1KkoJehRVeg

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

@calloni I would avoid the TI functions entirely. DAX TI functions are an utter abomination and anyone/anything that suggests using them is off base. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

 


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks for the candid reply Greg.

 

I am coming from a Tableau world where all this is pretty straight forward and the learning curve is pretty deep. That's why I had some friends recommending using Bravo for Time Intelligence and was really helpful until I saw this problem.

 

I will take a look at your video and see if I can learn anything as DAX is really a language more devoted to programmers than to folks from human related areas like myself. I have SQL experience and worked with data for a while, Tableau was a liberation for me, but the move to PBI DAX is really combersome.

 

Rodrigo

VijayP
Super User
Super User

@calloni 

In first place you need not use Total Downloads with Calculate , Simple Sum(Downloads) willl work

On QTD which quarter you are looking and whether primary data avaialble in that period.




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Hello Thanks for your message

 

I created a Measures Table and opted to put all calculations there so I can go in one place to see all measures. This data model is very complex, but thanks for your suggestion.

 

I am looking to get the total downloads for the current quarter (Q1 2024). YTD works fine, but QTD doesn't (from the calculations I got from Bravo).

 

Thanks

Rodrigo

@calloni , The only reason I can think of that YTD is working and QTD is not working is that you do not have a date filter on the page, also visual is not using any period from Calendar. In such case, TD functions take the last date in the calendar. I am assuming your calendar is till year end and such case datesqtd will give the last qtr of the year and will not show data.

 

In such cases better default page with the current month or qtr( You can use relative date slicer for that)

 

Why DATESMTD is still blank, even after having correct TI Setup: https://youtu.be/j0ug-XQgZtg

Why previousmonth does not give result when datesmtd -1 1 month is giving it: https://youtu.be/1KkoJehRVeg

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

Thanks very much for this information. Indeed the date was not part of the visual (the metric was used in a KPI card). I was able to replace the Calendar(Date) to the fact table date and it is now working.

 

Thanks again! It was very helpful!
Rodrigo

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.