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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Stroop
Frequent Visitor

Totalqtd not showing values for last week in quarter

Hey

 

I had a question a while ago but didn't get resolved

 

http://community.powerbi.com/t5/Desktop/totalqtd-not-returning-values-for-last-week-in-the-quarter/m...

 

basically I have data showing target values for each weke in the quarter. However when using the totalqtd function it calculates it correct for the first 12 weeks in the quarter but is blank for the 13th week. (e.g. 26/07/2018 - 01/07/2018).

 

Presumably this is down to it thinking the 1st is Q3 so doesn't register this week as Q2. However for us, the quarter starts on the first Monday so want to include. it. Is there a way to change this?

5 REPLIES 5
Greg_Deckler
Super User
Super User

Probably not, but this is why I created my Time Intelligence The Hard Way quick measure for these kinds of situations:

 

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



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg

 

What i do have is a separate file I uploaded containing date and quarter (with quarter when I want it to start/end each year). I feel I should be able to create a custom column/measure using this quarter but not quite figured out how.

Any chance you can post some sample data? The techniques I mentioned in my quick measures should work for this, but sample/example data allows me to get more specific about solutions. But, the main trick is to use VAR's to calculate your current quarter/month/year. Another VAR based on that to get your previous quarter/month/year. You use a SUMMARIZE to create a temp table in another VAR and from that you can use the MAXX, SUMX, AVERAGEX functions with a filter on that temp table to return the result you are looking for. But, it varies based upon the exact situation.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

In the previous post (link in my original post above) there is some sample data that I made up. 

Sorry, seems like we went down this road before, that's the danger of doing stuff in your spare time, sometimes I lose track of threads. See the attached PBIX. I believe what you want is this (or something close):

 

Measure = 
VAR __currentWeek = MAX([Week])
VAR __currentQuarter = MAX([Quarter])
VAR __currentYear = MAX([Year])
VAR tmpTable = FILTER(ALL(Table1),[Year] = __currentYear && [Quarter]=__currentQuarter && [Week]<=__currentWeek)
RETURN SUMX(tmpTable,[Target]) 

I added the Index because your dates are different than the US and I was too lazy to fix them all.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.