Forum Discussion
Need Help with QTD - Custom Calendar
I have created the following calc:
Try applying the ALL only to week and quarter instead of the whole table.
QTD CY = CALCULATE ( SUM ( NFSOP_SecVol_TD[UCs] ), FILTER ( ALL ( NFSOP_SecVol_TD[445 Quarter Number], NFSOP_SecVol_TD[Week #] ), NFSOP_SecVol_TD[445 Quarter Number] = MAX ( NFSOP_SecVol_TD[445 Quarter Number] ) && NFSOP_SecVol_TD[Week #] <= MAX ( NFSOP_SecVol_TD[Week #] ) ) )hstgeorge , On a similar problem this what I have done
Added new column to date table
Start of Year = STARTOFYEAR(Dates[Date],"1/31") // Change year end date Add Qtr = QUOTIENT(DATEDIFF(Dates[Start of Year], Dates[Date],MONTH),3)*3 Strat of Qtr = date(year(Dates[Start of Year]), month(Dates[Start of Year])+Dates[Add Qtr],1) Qtr No = "Q"& QUOTIENT(DATEDIFF(Dates[Start of Year], Dates[Date],MONTH),3)+1 Week # = as per your calcCreated measures like
LQ New = CALCULATE(SUM(NFSOP_SecVol_TD[UCs], FILTER(ALL(Dates), Dates[Qtr Rank] =max(Dates[Qtr Rank])-1 && Dates[Week #] = Max(Dates[Week #]))) LQ Running Total New = CALCULATE(SUM(NFSOP_SecVol_TD[UCs], FILTER(ALL(Dates), Dates[Qtr Rank] =max(Dates[Qtr Rank])-1 && Dates[Week #] <= Max(Dates[Week #])))- Anonymous6 years ago
Hi hstgeorge ,
Check the formual and see if it's what you want.
If not, please share some sample data and expected result to us.
QTD CY = CALCULATE(SUM('Table'[value]), FILTER( ALLEXCEPT('Table','Table'[geographical zone]), 'Table'[quarter] = MAX('Table'[quarter]) && 'Table'[week] <= MAX('Table'[week]) ) )Best Regards,
Jay
4 Replies
- Greg_DecklerCommunity Champion
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2. - jdbuchanan71Super User
Try applying the ALL only to week and quarter instead of the whole table.
QTD CY = CALCULATE ( SUM ( NFSOP_SecVol_TD[UCs] ), FILTER ( ALL ( NFSOP_SecVol_TD[445 Quarter Number], NFSOP_SecVol_TD[Week #] ), NFSOP_SecVol_TD[445 Quarter Number] = MAX ( NFSOP_SecVol_TD[445 Quarter Number] ) && NFSOP_SecVol_TD[Week #] <= MAX ( NFSOP_SecVol_TD[Week #] ) ) ) - amitchandakSuper User
hstgeorge , On a similar problem this what I have done
Added new column to date table
Start of Year = STARTOFYEAR(Dates[Date],"1/31") // Change year end date Add Qtr = QUOTIENT(DATEDIFF(Dates[Start of Year], Dates[Date],MONTH),3)*3 Strat of Qtr = date(year(Dates[Start of Year]), month(Dates[Start of Year])+Dates[Add Qtr],1) Qtr No = "Q"& QUOTIENT(DATEDIFF(Dates[Start of Year], Dates[Date],MONTH),3)+1 Week # = as per your calcCreated measures like
LQ New = CALCULATE(SUM(NFSOP_SecVol_TD[UCs], FILTER(ALL(Dates), Dates[Qtr Rank] =max(Dates[Qtr Rank])-1 && Dates[Week #] = Max(Dates[Week #]))) LQ Running Total New = CALCULATE(SUM(NFSOP_SecVol_TD[UCs], FILTER(ALL(Dates), Dates[Qtr Rank] =max(Dates[Qtr Rank])-1 && Dates[Week #] <= Max(Dates[Week #]))) - AnonymousNot applicable
Hi hstgeorge ,
Check the formual and see if it's what you want.
If not, please share some sample data and expected result to us.
QTD CY = CALCULATE(SUM('Table'[value]), FILTER( ALLEXCEPT('Table','Table'[geographical zone]), 'Table'[quarter] = MAX('Table'[quarter]) && 'Table'[week] <= MAX('Table'[week]) ) )Best Regards,
Jay