Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Using slicer for sum of columns

Suppose I have the following data:   Name Country January February March April May June July August September October November December Alex USA 14 0 74 12 13 98 13 100 ...
  • selimovd's avatar
    5 years ago

    Hey Anonymous ,

     

    you should unpivot the month columns. You can do that like this:

     

     

    Then you can rename the "Attribute" column to "Date", replace the values with real dates and then you can slice by date in the report.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • parry2k's avatar
    5 years ago

    Anonymous understood, but as a best practice and a scalable solution, it is always good to have unpivoted data. There is always create a better model or write a complex DAX to achieve the business goal. You decide what to pick. So better to revisit your solution by revisiting that this needs to be unpivoted. All the best. 

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • Anonymous's avatar
    Anonymous
    5 years ago

    Anonymous 

    Dax calculation is based on rows not column, the best solution for is to transform the table making the month into rows then you can create a slicer to filter to interact. If you are worrying about later report creation. You can just duplicate the table then use the new table for this sum calculation.

     

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.