Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
hebbal_arun
New Member

Day and wek sales in same chart

hebbal_arun_0-1718370477860.png

Can you please help me with how to display daily, weekly, and monthly sales in the same chart as shown in the image above?

1 ACCEPTED SOLUTION
PabloVallejo12
New Member

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

View solution in original post

2 REPLIES 2
rajendraongole1
Community Champion
Community Champion

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:

rajendraongole1_3-1718375373876.png

 

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
)

 

rajendraongole1_4-1718375426393.png

 

 

 

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:

rajendraongole1_7-1718375646570.png

 

Daily report:

 

rajendraongole1_1-1718375245203.png

 

 

Weekly Report:

rajendraongole1_5-1718375508783.png

 

Monthly Report button bookmark and pass the action to button created above

rajendraongole1_6-1718375558225.png

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

PabloVallejo12
New Member

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors