cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper I

## Weekly sum divide by number of days and visualize on a bar chart

This is a very simplified version of my table. The actual one has like 20+ columns. I want to add up the orders for the whole week, divide by the number of days and visualize it on the bar chart. So, for each date, the value will look like this. For 11 to 15 sept week, the total 510 divided by 5days is 84. All the days are weekdays, monday to friday.

The graph will look like this. The orders by date.

How shall I achieve this?

thanks all.

1 ACCEPTED SOLUTION
Community Support

Hi @katto16 ,

You can create a measure as below to get it, please find the details in the attachment.

``````Measure =
VAR _seldate =
SELECTEDVALUE ( 'Table'[Date] )
VAR _sumoforders =
CALCULATE (
SUM ( 'Table'[Orders] ),
FILTER (
ALLSELECTED ( 'Table' ),
WEEKNUM ( 'Table'[Date], 2 ) = WEEKNUM ( _seldate, 2 )
)
)
RETURN
DIVIDE ( _sumoforders, 5 )``````

And for the number of days, from Sep 18 to Spe 23, it will be 6 days. So it will divided by 6?

Best Regards

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

Hi @katto16 ,

You can create a measure as below to get it, please find the details in the attachment.

``````Measure =
VAR _seldate =
SELECTEDVALUE ( 'Table'[Date] )
VAR _sumoforders =
CALCULATE (
SUM ( 'Table'[Orders] ),
FILTER (
ALLSELECTED ( 'Table' ),
WEEKNUM ( 'Table'[Date], 2 ) = WEEKNUM ( _seldate, 2 )
)
)
RETURN
DIVIDE ( _sumoforders, 5 )``````

And for the number of days, from Sep 18 to Spe 23, it will be 6 days. So it will divided by 6?

Best Regards

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