Forum Discussion

Ashik008's avatar
Ashik008
Frequent Visitor
3 years ago
Solved

Sale in quarter

Hi all, Please help to find a sql query to calculate the total sales in quarter  table as follow  Product Month number year sale A 2 2022 1000 B 2 2022 2000 c 1 2022 1000 ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Ashik008 ,

    Please try to create a new column with below dax formula:

    Quarter =
    VAR cur_year = 'Table'[year]
    VAR cur_month = 'Table'[Month number]
    VAR _date =
        DATE ( cur_year, cur_month, 1 )
    RETURN
        "Quarter" & QUARTER ( _date )
    

    Add a table visual with fields:

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.