Forum Discussion

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

total sales in different years

 In the DateKey sales table, this is the only column related to date and year. I converted it to year. The years range from 2006-2008. I want to calculate sales by years.  For example, total sales in 2006, 07, and 08 in Asia, Europe and NA. I tried to write DAX measures but my formula is not working. Could you please help me? 

  • In that case you can convert it to list from the drop down in the top right corner of slicer as shown below :-

     

9 Replies

  • Hello

    1) Do you have a Date table?

    2) Give us the Dax measure you tried

  • Hello,
    1. Yes, I have a Date table. This is the picture of the table 
    2.  sales_07 = SUM(FILTER(FactOnlineSales, RELATED(DimDate[Datekey]) = 2007),FactOnlineSales[SalesAmount]) -- this measure is for specific year, 2007. but I want to filter all the years togather. Nothing is working. 
    • Kucrapok's avatar
      Kucrapok
      Icon for Helper I rankHelper I

      It seems weirs to me to have year as the datekey in the date table. Is their a relathionship between your sales table and th date table?

      If yes on what column?

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi Anik ,

     

    Can you try to add sales data from your "FactOnlineSales" table and Dates from Date table in your table visual.

    Now use Date from date table as slicer. It will help you to get desired output.

     

    Thanks,

    Samarth