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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

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

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

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.