Forum Discussion

arifsyeduk1's avatar
arifsyeduk1
Icon for Helper I rankHelper I
5 years ago
Solved

QTD for Selected Month

Hi,

I have the QTD for Qty working and if I have a simple example with columns

Product, Year, Qtr, Month, QTD, the QTD value is correct. However, if I select any month from a slicer based on a Calendar table, Period column, say 202102 the value for QTD only includes 202102 Qty. QTD does not include 202101.

 

However, If I use a slicer based if the in-built Date Hierarchy that PBI builds from the Date_PK (Calendar table) and select 202102 it works.

 

Using the std formula : [CM] is Qty

CY-QTD = TOTALQTD([CM], 'Calendar'[date_pk].[Date]).
 
Hope that makes sense. Filter on generated Calendar.Date Hierarchy works, filter on Period column in the same Calendar table, it does not
  • Figured this out, to be able to use a Month, Qtr field from the Calendar table other than from the default Date Hierarchy, I used the following formula. I can now select just a single month and it will display the correct QTD for that month. So selecting Feb-21 will include Jan-21 and Feb-21 in the QTD calulation

     

    CALCULATE('monthlyKpi2'[CM], DATESQTD('Calendar'[date_pk]) )

     

2 Replies

  • Figured this out, to be able to use a Month, Qtr field from the Calendar table other than from the default Date Hierarchy, I used the following formula. I can now select just a single month and it will display the correct QTD for that month. So selecting Feb-21 will include Jan-21 and Feb-21 in the QTD calulation

     

    CALCULATE('monthlyKpi2'[CM], DATESQTD('Calendar'[date_pk]) )

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi arifsyeduk1 ,

      So you have resolved the problem by yourself? Is there anything else need help with this thread? If no, could you please mark your post as Answered?  It will help the others in the community find the solution easily if they face the same problem with you. Thank you.

      Best Regards