Forum Discussion

tomislav_mi's avatar
tomislav_mi
Helper II
4 years ago

Calculated column for account-customer level

Hello guys,

Hope you can help!

I have a table like below and would need to create a calcualted columns in orange.
Basically what I am trying to solve is to create column that creates channel labels based on SalesAccount column.
If SalesAccount is 0 then I would look at only active ChannelAccount from specific month and ChannelCustomer will
become more accurate ChannelActive. 

MonthAccountCustomerChannelAccountChannelCustomerSalesAccountChannelActive
JanGutGABBADirectBoth50Both
JanBaloonABBAResellerBoth45Both
FebGutGABBADirectBoth50Direct
FebBaloonABBAResellerBoth0

Direct

 

Thanks to everybody who wants to take a shot at solving this challenge.

Best!

3 Replies

  • Hi tomislav_mi ,

     

    Is this case how do you know that the specific customr is Direct? In the last line you have Direct e Reseller but you select the Direct whow do you know what is the value to pick up, also do you want to have that calculation only on that specific month, or for all months forward also?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi tomislav_mi ,

     

    Please refer this formula:

    Column = 
    var _min = CALCULATE(MIN('Table'[SalesAccount]),ALLEXCEPT('Table','Table'[Month]))
    var _active = CALCULATE(MAX('Table'[ChannelAccount]),FILTER(ALLEXCEPT('Table','Table'[Month]),'Table'[SalesAccount]<>0))
    return
    IF(_min=0,_active,'Table'[ChannelCustomer])

    If I misunderstood your meaning, please show more details.

     

    Best Regards,

    Jay

    • tomislav_mi's avatar
      tomislav_mi
      Helper II

      Anonymous MFelix 

      Thank you very much for your help.
      The proposed solution from above is not the right way to go.

      I will try to formulate the problem in other words:

      The process goes like this:
      1) identify the channel account that is active in an observed month ( column Active Channel Account refers to that)
      2) use that active channel for a customer level (desired column Active Channel Customer )
      3) if there is more than 1 value then Active Channel Customer is going to be "Both"

      IndexReport DateAccountCustomerChannel AccountPaymentActiveActive Channel AccountActive Channel Customer
      252056/30/2022 0:00a1aDirect FALSE Reseller
      252156/30/2022 0:00a2aReseller500TRUEResellerReseller
      252986/30/2022 0:00a3aDirect FALSE Reseller
      353736/30/2022 0:00a4aReseller600TRUEResellerReseller
      252057/31/2022 0:00a1aDirect FALSE Direct
      252157/31/2022 0:00a2aReseller FALSE Direct
      252987/31/2022 0:00a3aDirect45454TRUEDirectDirect
      353737/31/2022 0:00a4aReseller FALSE Direct
      151356/30/2022 0:00b1bDirect1234TRUEDirectBoth
      153546/30/2022 0:00b2bReseller8745TRUEResellerBoth