cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
zuro16
New Member

Assign legend "low margin" based on margin percentage per order type

I have three order types based on "order" being with external customer (order type ZS02) or internal customer (order types ZS03, ZS04). I'd like to assign the legend "low margin" ( on new column) based on thresholds defined per the order types. The thresholds are 12% or less than 12% for order typeZS02, 7.5% or less for order type ZS03, and 6.4% or less for order type ZS04. Below a mock table of the final -desired- output ( last column would be the column with the legend). How can this be accomplished

 

OrderOrder TypeMarginText assignment ( New column)
azs0215% 
bzs032%Low Margin
czs043%Low Margin
dzs039% 
ezs0410% 
fzs0210%Low Margin
gzs034%Low Margin
hZS0216% 
iZS045%Low Margin
1 ACCEPTED SOLUTION

Accepted Solutions
Super User I
Super User I

Re: Assign legend "low margin" based on margin percentage per order type

@zuro16 

 

Are you trying to create the new column(4th col) in the mockup?

 

Try this as a calculated column

Column = SWITCH(TRUE(),
'Table (2)'[Order Type] = "zs02" && 'Table (2)'[Margin] <=0.12,"Low Margin",
'Table (2)'[Order Type] = "zs03" && 'Table (2)'[Margin] <=0.075,"Low Margin",
'Table (2)'[Order Type] = "zs04" && 'Table (2)'[Margin] <=0.064,"Low Margin",
BLANK())

 

image.png

 

If it helps, mark it as a solution

Kudos are nice too

View solution in original post

3 REPLIES 3
Super User I
Super User I

Re: Assign legend "low margin" based on margin percentage per order type

@zuro16 

 

Are you trying to create the new column(4th col) in the mockup?

 

Try this as a calculated column

Column = SWITCH(TRUE(),
'Table (2)'[Order Type] = "zs02" && 'Table (2)'[Margin] <=0.12,"Low Margin",
'Table (2)'[Order Type] = "zs03" && 'Table (2)'[Margin] <=0.075,"Low Margin",
'Table (2)'[Order Type] = "zs04" && 'Table (2)'[Margin] <=0.064,"Low Margin",
BLANK())

 

image.png

 

If it helps, mark it as a solution

Kudos are nice too

View solution in original post

zuro16
New Member

Re: Assign legend "low margin" based on margin percentage per order type

Thanks much VasTg!

zuro16
New Member

Re: Assign legend "low margin" based on margin percentage per order type

@VasTg  What if one the lines is negative (less than 0 <zero>) on the planned margin ( on any of the order types), and instead of returning the legend "low margin", I'd like to get the word "Negative margin", but -still- I'd like to keep the "low margin" on those above 0 (zero) margin? is this something we can build on top of the formula you've suggested or this would be an entirely different formula? Thank you, Carlos.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors