Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Previous Quarter Filter HELP!

Looking for some assistance through this process
(Table and chart for reference)


What I would like to accomplish is to be able to filter the first table, using the dates & time from the chart (Or Table1[Date] as reference.) I want to filter the table according to the dates associated with the LAST/PREVIOUS quarter from today's date. For example, since it's the beginning of April I only want the table to show the last quarter (3 months) being January1-March31. 

All the data comes from the same query, and I know theres an option to filter the DATE/TIME column in the editor, but I'm using the dates for other stuff as well so I would only like to filter it for the specific visual. It would be convenient if I was able to add the date filter directly on the visual.

I tried playing around with the PREVIOUSQUARTER function, but I'm still a beginner and had no success. I would appreciate it if someone could guide me through the process of creating such a filter, whether it's using a measure of table calculation. Thanks! 

4 Replies

  • You can use datesqtd and totalqtd and force them to go till end of quarter . Example

    QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
    Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))
    
    Last complete QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER))))
    Last to last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-2,QUARTER)))
    Next QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],1,QUARTER)))
    Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))
    Last year same QTD Sales complete= CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER(dateadd('Date'[Date],-1,Year))))

     

    To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
    https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
    https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
    https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

    • v-xuding-msft's avatar
      v-xuding-msft
      Icon for Community Support rankCommunity Support

      Hi Anonymous ,

      Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from the thread.

       

      Best Regards,

      Xue Ding

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.