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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Need help with calculation

Hello all,

 

I have a rather complex problem and I am in need of a little help. I am not as familiar with DAX as I would like to be, which may be the reason I can't seem to figure this out. 

 

My data set has: 

- Different offices w/ an office code

- This office code is part of a larger code used in different proposal codes

- There is a regional vs. national tag for contributions to specific proposals

 

I need to make a list of proposals that a specific office made to themselves at a regional level. I was going to do this via a CONTAINS statement. Since the proposal code has the office code in it, if the office code had an exact match in the proposal code, then I would have the list I need. However, I have not been able to get this to work. 

 

Any help would be appreciated on this!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1697166272697.png

 

Here are the steps you can follow:

1. Create measure.

Measure =
MAXX(
FILTER(ALL(Table2),
CONTAINSSTRING(
    'Table2'[proposal codes],MAX('Table1'[office code]))=TRUE()),[Regional])

2. Result:

vyangliumsft_1-1697166272698.png

If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1697166272697.png

 

Here are the steps you can follow:

1. Create measure.

Measure =
MAXX(
FILTER(ALL(Table2),
CONTAINSSTRING(
    'Table2'[proposal codes],MAX('Table1'[office code]))=TRUE()),[Regional])

2. Result:

vyangliumsft_1-1697166272698.png

If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

parry2k
Super User
Super User

@Anonymous It will be easier if you post some data with the expected output. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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