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
GarryPope
Advocate I
Advocate I

DATEQTD showing Blank

Hello Power BI Community, 

Could you please help with a DAX issue I have? 

I have three tables: Transaction, Fiscal Calendar, Measures.

In my Transaction table I have a list of Transactions with a specific date. 

I'm trying to get the DATESQTD to show me the total of all transactions for the quarter to date, but I keep getting a blank value. 

Below is the DAX I'm using in a measure. 

DATESQTD: Payments in =
CALCULATE(
                   SUM(Transactions[Payments in]),
                   DATESQTD('Fiscal Calendar'[Date])
          )


Any idea why I am getting a blank rather than the figure £22,603.81?

GarryPope_0-1652504043334.png

Thanks very much,
Garry

PS. not sure if this helps, but the parameters for my Fiscal Year table are below. 

GarryPope_1-1652504148920.png

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @GarryPope ;

I tested it, and I already know why. Your calendar is filled with dates for the entire 2014-2023 calendar year (up to May). I think THE QTD calculation uses the last quarter in the calendar, april-May 2023. There is no 2023 data in the Transaction table, so it appears blank in the card visual object. If I change the query on my calendar to show only through May 2022, everything works as expected.

vyalanwumsft_0-1652754133634.png

vyalanwumsft_1-1652754410445.png

When i select  year 2013-2014. is not blank.

vyalanwumsft_2-1652754436465.png

 

Or you could change the measure as follow:

Qtd = CALCULATE(SUM([ Sales]),FILTER(ALLSELECTED('financials'),YEAR([Date])=YEAR(TODAY())&&QUARTER([Date])=QUARTER(TODAY())))


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @GarryPope ;

I tested it, and I already know why. Your calendar is filled with dates for the entire 2014-2023 calendar year (up to May). I think THE QTD calculation uses the last quarter in the calendar, april-May 2023. There is no 2023 data in the Transaction table, so it appears blank in the card visual object. If I change the query on my calendar to show only through May 2022, everything works as expected.

vyalanwumsft_0-1652754133634.png

vyalanwumsft_1-1652754410445.png

When i select  year 2013-2014. is not blank.

vyalanwumsft_2-1652754436465.png

 

Or you could change the measure as follow:

Qtd = CALCULATE(SUM([ Sales]),FILTER(ALLSELECTED('financials'),YEAR([Date])=YEAR(TODAY())&&QUARTER([Date])=QUARTER(TODAY())))


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

GarryPope
Advocate I
Advocate I

Update... Okay, so I realised what I did. In the above DAX I used the column Date from my Fiscal Calendar table.

When I used the Date column from my Transaction table it gave the correct figure.

GarryPope_0-1652504811512.png


This is great, but my next question is please, why didn't the Date column in the Fiscal Calendar work?

Thanks,

Garry




Hi,

Ensure that there is a relationship (Many to One and Single) from the Date column of the Transaction Table to the Date column of the Calendar Table.  Your initial measure should work.  Furthermore, in a card visual since ther is no filter context, I would not be surprised if you still see a blank.  For a QTD calculation to work, one must drag Year and Quarter from the Calednar Table (to a Table/matrix visual).


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.