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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KyleAD0110
Regular Visitor

Variable Category

Hi,

 

I'm trying to work out a way of categorising data where those categories update when filters are applied. The data I'm using can't be shared so I will use generic notes to explain.

 

A client, say Bob, has work done from team A, B and C which all charge fees. I have a set of fee categories such as, "£1m+", "£750k-£1m", etc... which categorises all of my clients based on their fees. Say Bobs fees are £1.2m, Bob lies within the "£1m+" category. So this is looking at the sum of the Fees of Team A for Bob, Team B for Bob, Team C for Bob.

 

ClientTeamFees
BobA300,000
BobB500,000
BobC400,000

 

Before filtering - £1,200,000, gives category of £1m+.

If I then filter to just Team A, I want it to then see fees are £300,000, so £250k-£500k category.

 

My data is more than one client so then want to be able to list it like the below which can then be filtered by Team.

 

CategoryFees
£1m+XXXX
£750k-£1mXXX
and so on.... 

 

Thank you for your help in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @KyleAD0110 ,

 

According to your description, do you want to filter the table by Team and show the type of total Fee per Team for each client? If so, here is my test for your reference. Please reply to me if I missed anything. I also attached pbix file for your reference.

 

Measure1: Calculate sum of Fees for each client.

TotalFees = VAR selectedTeam = SELECTEDVALUE('Table'[Team])
RETURN IF(ISBLANK(selectedTeam),CALCULATE(SUM('Table'[Fees]),FILTER(ALL('Table'),'Table'[Client]=MAX('Table'[Client]))),CALCULATE(SUM('Table'[Fees]),FILTER(ALL('Table'),'Table'[Client]=MAX('Table'[Client])&&'Table'[Team]=selectedTeam)))

Measure2: Set category acoording to total of fees.

Category = IF([TotalFees]>=1000000,"£1m+",IF([TotalFees]>=750000,"£750k-£1m","below £750k"))

vmengmlimsft_0-1729737160231.png

 

 

 

 

Best regards,

Mengmeng Li

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @KyleAD0110 ,

 

According to your description, do you want to filter the table by Team and show the type of total Fee per Team for each client? If so, here is my test for your reference. Please reply to me if I missed anything. I also attached pbix file for your reference.

 

Measure1: Calculate sum of Fees for each client.

TotalFees = VAR selectedTeam = SELECTEDVALUE('Table'[Team])
RETURN IF(ISBLANK(selectedTeam),CALCULATE(SUM('Table'[Fees]),FILTER(ALL('Table'),'Table'[Client]=MAX('Table'[Client]))),CALCULATE(SUM('Table'[Fees]),FILTER(ALL('Table'),'Table'[Client]=MAX('Table'[Client])&&'Table'[Team]=selectedTeam)))

Measure2: Set category acoording to total of fees.

Category = IF([TotalFees]>=1000000,"£1m+",IF([TotalFees]>=750000,"£750k-£1m","below £750k"))

vmengmlimsft_0-1729737160231.png

 

 

 

 

Best regards,

Mengmeng Li

 

lbendlin
Super User
Super User

My data is more than one client 

 

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.