cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yve214
Helper II
Helper II

Help with Dax measure for target counts per quarter

If I am given a target per quarter for a report.

 

For instance

Q1 = 6, 

Q2 = 6, 

Q3 = 6, 

Q4 = 6

so basically for each calendar quarter I am given a standard 6 total of sale items.

 

How can i get the rolling total say I select February 5th. I am assuming those 6 will be divided by 90 days for me to get an accrued exact target from quarter start to feb 5th, approx. 2.4 items, or if i selected April 2nd, I should expect approx. 5.52. assuming I am drividing the target (6) by (90 days) of each quarter. 

 

I want to be able to select a particular date and I get like the qtd rolling total of the target. I know I could assign variables for each quarter and then return the conditions to which I want them, but i dont think that works the way I want it. Please advise, thank you.

1 ACCEPTED SOLUTION
johnt75
Solution Sage
Solution Sage

You could try multiplying your calculated daily target by COUNTROWS(DATESQTD('Date'[Date])).

And if you wanted to get the actual number of days in the chosen quarter, rather than assuming a flat 90, you could try something like

Days in quarter = CALCULATE( COUNTROWS('Date'), REMOVEILTERS('Date'), 
'Date'[Year] = SELECTEDVALUE('Date'[Year]) && 'Date'[Quarter] = SELECTEDVALUE('Date'[Quarter]))

View solution in original post

2 REPLIES 2
johnt75
Solution Sage
Solution Sage

You could try multiplying your calculated daily target by COUNTROWS(DATESQTD('Date'[Date])).

And if you wanted to get the actual number of days in the chosen quarter, rather than assuming a flat 90, you could try something like

Days in quarter = CALCULATE( COUNTROWS('Date'), REMOVEILTERS('Date'), 
'Date'[Year] = SELECTEDVALUE('Date'[Year]) && 'Date'[Quarter] = SELECTEDVALUE('Date'[Quarter]))

@johnt75 

 

Thank you so much for this solution. Everything worked as expected.

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.