Implementing a Slicer to Toggle Between Daily Monthly and Yearly Sales Aggregation

0 votes

Implementing a Slicer to Toggle Between Daily, Monthly, and Yearly Sales Aggregation
Your Power BI report contains a line chart showing sales over time, and the client wants an option to toggle between "Daily," "Monthly," and "Yearly" aggregation using a slicer. What is the best way to implement this using DAX and Power BI features to ensure smooth user interaction?

15 hours ago in Power BI by Evanjalin
• 17,020 points
17 views

1 answer to this question.

0 votes

1. Create an Aggregation Table with values: Daily, Monthly, Yearly.

2. Create a DAX Measure using SWITCH to adjust aggregation:

Sales Aggregation = 
SWITCH(
    SELECTEDVALUE(AggregationTable[Aggregation], "Daily"),
    "Daily", SUM(Sales[Amount]),
    "Monthly", CALCULATE(SUM(Sales[Amount]), VALUES('Date'[YearMonth])),
    "Yearly", CALCULATE(SUM(Sales[Amount]), VALUES('Date'[Year])),
    SUM(Sales[Amount])
)

3. Add a Slicer using AggregationTable[Aggregation] and use Sales Aggregation in a line chart.

answered 15 hours ago by anonymous
• 17,020 points

Related Questions In Power BI

0 votes
0 answers
0 votes
0 answers
+1 vote
3 answers

How do I create a flexible date range slicer that allows users to switch between monthly, quarterly, and yearly views?

Proper date hierarchy and dynamic date filters ...READ MORE

answered Nov 12, 2024 in Power BI by pooja
• 16,420 points
158 views
0 votes
1 answer

How to Toggle Between Two Option and Make it Interact with the rest of the Visualizations in a Report?

Toggling is an action that is achieved ...READ MORE

answered Oct 20, 2020 in Power BI by anonymous
• 65,770 points
1,182 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,507 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,130 points
2,858 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,520 points
1,640 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Open power bi report nd sign in ...READ MORE

answered Oct 10, 2023 in Power BI by Monika kale

edited 4 hours ago 1,778 views
0 votes
1 answer

What are the best practices for using Power BI connectors to monitor user activities and interactions within a dashboard?

Power BI dashboards. Some best practices for ...READ MORE

answered Feb 24 in Power BI by anonymous
• 17,020 points
45 views
0 votes
1 answer

What are the steps to create and customize a Waterfall chart in Power BI?

A Waterfall chart in Power BI is ...READ MORE

answered 6 days ago in Power BI by anonymous
• 17,020 points
42 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP