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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
Community Champion
Community Champion

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

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

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

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors