cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
katto16
Helper I
Helper I

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

katto16_0-1695194986772.png

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.

katto16_1-1695199015221.png

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

katto16_3-1695199706571.png

 

How shall I achieve this?

 

thanks all.

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
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 )

 

vyiruanmsft_0-1695351321545.png

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.

View solution in original post

1 REPLY 1
v-yiruan-msft
Community Support
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 )

 

vyiruanmsft_0-1695351321545.png

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.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors