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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tyan
Helper II
Helper II

How to split week and calculate percentage

tyan_0-1643176985107.png

here is the database.

I would like to see following graph. I dont know how to calculate week and split them up. Week: ( oc ship- final pass)  which the result is in column G.

After finiding weeks, I need to splirt them into  on time( yes), 1week, 2 weeks 3weeks, 4weeks etc..

and them need to split by app(apperal) footware(fw), hardware(hw) .. 

and calcualre the quantity.

dd8c153cba0bc766cb36da10147d587.jpg

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @tyan ,

You can create a calculated column as below to get the status:

 

On time? =
SWITCH (
    TRUE (),
    [Column G] < -28, "4 week+",
    [Column G] >= -28
        && [Column G] < 21, "4 week",
    [Column G] >= -21
        && [Column G] < 14, "3 week",
    [Column G] >= -14
        && [Column G] < 7, "2 week",
    [Column G] >= -7
        && [Column G] < 0, "1 week",
    [Column G] >= 0, "On time"
)

 

Then create a culstered column chart with the settings(Axis: On times?  Legend: BU  Values: xx)

yingyinr_0-1643619290251.png

If the above one can't help you get the desired result, please share some sample data with Text format and your expected result with backend logic and special examples in order to provide a suitable solution. Thank you.

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

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @tyan ,

You can create a calculated column as below to get the status:

 

On time? =
SWITCH (
    TRUE (),
    [Column G] < -28, "4 week+",
    [Column G] >= -28
        && [Column G] < 21, "4 week",
    [Column G] >= -21
        && [Column G] < 14, "3 week",
    [Column G] >= -14
        && [Column G] < 7, "2 week",
    [Column G] >= -7
        && [Column G] < 0, "1 week",
    [Column G] >= 0, "On time"
)

 

Then create a culstered column chart with the settings(Axis: On times?  Legend: BU  Values: xx)

yingyinr_0-1643619290251.png

If the above one can't help you get the desired result, please share some sample data with Text format and your expected result with backend logic and special examples in order to provide a suitable solution. Thank you.

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.

It works well! thank you for helping me 

Hi @tyan ,

Thanks for your feedback. It's glad to hear that it can help you. Could you please mark the helpful post as Answered? It will help the others in the community if they face the same problem with you. Thank you.

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.
amitchandak
Super User
Super User

@tyan Create a new column like

 

var _q = quotient(abs([final ins]),7) +1 ,

Switch(True() ,

[final ins] = 0, "  On Time" ,

" Week" & _q )

 

and use that visual

@amitchandak  hi, thank you for helping me. It doesnt work tho. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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