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
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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

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