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
tomislav_mi
Helper II
Helper II

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 3
v-jayw-msft
Community Support
Community Support

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])

vjaywmsft_0-1654245973022.png

If I misunderstood your meaning, please show more details.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

@v-jayw-msft @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



MFelix
Super User
Super User

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?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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.