cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rjg2g11 Regular Visitor
Regular Visitor

Max Value of two variables

Hello 

 

Please see table below - I am trying to calculate the 'Max of both Colours Column'. 

 

I am trying to calculate the Max In Stock of the two colours from the Shop provided, in a column. For example, Shop A has Black_A and Black_B, and i would like to calculate the max In Stock value of them both, and create a column of that, in this case 1. At the same time, i would also like to find out the MAX in stock value of Silver_A and Silver B. I would like to do this for multiple shops

 

We havent got anywhere with this, but would appreciate your help!

 

Thanks

 

ShopColourIn Stock?Max of both colours
ABlack_A11
ABlack_B11
ASilver_A11
ASilver_B01
BBlack_A00
BBlack_B00
BSilver_A01
BSilver_B11
CBlack_A11
CBlack_B11
CSilver_A00
CSilver_B00
5 REPLIES 5
Super User IV
Super User IV

Re: Max Value of two variables

When you say max of both colors, do you mean color is BLACK or SILVER?






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





rjg2g11 Regular Visitor
Regular Visitor

Re: Max Value of two variables

Hi @parry2k

 

i would like to find the max of Black_A or Black_B and also the max of Silver_A or Silver_B 

 

thanks 

Super User IV
Super User IV

Re: Max Value of two variables

understood but what groups black_a and Black_b in your data model.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





rjg2g11 Regular Visitor
Regular Visitor

Re: Max Value of two variables

@parry2k

 

This is the difficulty i have, nothing groups them - i need to pick them out of the column and find the max in stock value between them.

 

Thanks again

vik0810 Member
Member

Re: Max Value of two variables

Assuming your colours always have schema colour_x and only the part on the left of "_" counts, you can use following calculated column:

 

Max of colours = 

   MAXX(
    FILTER (
        Tabelle1,
        Tabelle1[Shop] = EARLIER ( Tabelle1[Shop] ) && LEFT(Tabelle1[Colour], FIND("_", Tabelle1[Colour])) = LEFT(EARLIER(Tabelle1[Colour]), FIND("_", EARLIER(Tabelle1[Colour])))
           
    ), Tabelle1[In Stock?])

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors