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
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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.