Forum Discussion

Junaid11's avatar
Junaid11
Icon for Helper V rankHelper V
3 years ago
Solved

3 Cards based on Quarter Sales

Hello,
I have a Sales table with date column in it. I want to create 3 cards showing current quarter sales, Last quarter Sales and Last year current quarter sales. It looks a simple function with QTD but when I am trying to do it it is showing error. I am attaching a table below along with the outcome I want to have. I need 3 DAX functions for all the three requirements of quarters.
Your help would be highly appreciated.

Date Sales 
Friday, November 5, 2021 $      3,457
Tuesday, December 21, 2021 $      8,236
Saturday, January 1, 2022 $      4,689
Thursday, February 3, 2022 $      4,575
Tuesday, April 19, 2022 $      8,264
Saturday, June 11, 2022 $      2,589
Saturday, July 23, 2022 $      4,939
Sunday, September 11, 2022 $      5,802
Sunday, November 13, 2022 $      6,082
Thursday, December 8, 2022 $      5,300

My Outcome are three data cards as per current data as below:

Thank you

4 Replies

  • You will have to define what you mean by "current quarter" and you should be using a calendar table in your data model that covers all required dates.

    I'll leave it up to you to figure out how to show the data on cards.

     

    See attached.

    • Junaid11's avatar
      Junaid11
      Icon for Helper V rankHelper V

      Hello lbendlin ,
      Thank you for the help. To clear you. Current quarter means the quarter that is right now like The month is December so Current quarter is quarter 4 because October, November and December comes under it

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Be aware that "current quarter" has a different meaning in Power BI.  It means "the quarter that the current filter context is looking at right now"  (as you can see from my table).