The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Can you please help me with how to display daily, weekly, and monthly sales in the same chart as shown in the image above?
Solved! Go to Solution.
You have 2 options :
- If you use Bookmarks, you can add buttons like in yout image
-Use a hierachy in the date, its more easy and you can drill down to see only year, month or days
Hi @hebbal_arun You have to create measures to calculate daily, weekly, and monthly sales seperately.
Eg: Daily Sales measure:
Daily Sales = SUM('Sales Table'[Sales])
Weekly Sales Measures:
Weekly Sales = CALCULATE(
SUM('Sales Table'[Sales]),
DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -7, DAY)
)
Monthly Sales Measures:
Monthly Sales = CALCULATE(
SUM('Sales Table'[Sales]),
DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -30, DAY)
)
Create a calculated table with three values as "Daily", "Weekly", and "Monthly".
DateLevel = DATATABLE(
"Period", STRING,
{
{"Daily"},
{"Weekly"},
{"Monthly"}
}
)
add above table as slicers chart in your report page:
Create a measure to switch between daily, weekly, and monthly views based on the slicer selection.
SelectedSales =
SWITCH(
TRUE(),
SELECTEDVALUE(DateLevel[Period]) = "Daily", [Daily Sales],
SELECTEDVALUE(DateLevel[Period]) = "Weekly", [Weekly Sales],
SELECTEDVALUE(DateLevel[Period]) = "Monthly", [Monthly Sales],
[Daily Sales] -- Default to daily sales if no selection
)
I hope you already have seperate date table, if not please create a date table because i am using in above measures.
1.Add a line chart to your report.Drag the Date field to the X-axis.Drag the daily Sales measure to the Values.
2.add another line chart to your report.Drag the Date field to the X-axis.Drag the Weekly measure to the Values.
3.add another line chart to your report.Drag the Date field to the X-axis.Drag the Monthly measure to the Values.
Create three bookmark buttons: one for Daily, one for Weekly, and one for Monthly from views tab.
Provide actions by selecting each button that bookmark created:
Daily report:
Weekly Report:
Monthly Report button bookmark and pass the action to button created above
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
You have 2 options :
- If you use Bookmarks, you can add buttons like in yout image
-Use a hierachy in the date, its more easy and you can drill down to see only year, month or days
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
141 | |
109 | |
107 | |
75 | |
61 |
User | Count |
---|---|
276 | |
129 | |
122 | |
100 | |
88 |