Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
darrigg
Frequent Visitor

Create Column to Change Cost Center # based on the customer level to line with highest balance.

Hi, I am trying to create a column to Change Cost Center # based on the customer level with highest balance. I want Account_Cost_Center to be the same on a customer level, based on the highest balance of that customer.

 

  • the balance field is Acct_Ledger_Balance_MTD_AVG
  • the customer level is Customer_CIS_Number
  • and the account cost center is Account_Cost_Center
  • it is coming all from "Query1

 

For example, in teh screenshot below, I want the "MAX COST CENTER" column to show the same:

  • for customer 43 as 330.
  • for customer 82 it should both be 331
  • for customer 302 it should all be 548

darrigg_0-1674575139415.png

 
this is what is generating 337 in the MAX COST CENTER column, but does not seem to work:
-------------
Max Cost Center =

var _max=MAXX(FILTER(ALL('Query1'),[Customer_CIS_Number]=MAX('Query1'[Customer_CIS_Number])),[Acct_Ledger_Balance_MTD_Avg])

return CALCULATE(MAX('Query1'[Account_Cost_Center]),

(FILTER(ALL('Query1'),[Customer_CIS_Number]=MAX('Query1'[Customer_CIS_Number])&&[Acct_Ledger_Balance_MTD_Avg]=_max)))
 
----------
 
Any idea?

 

 

0 REPLIES 0

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.