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
jason5703
Helper I
Helper I

Need to build a smart sub-table

This is probably pretty easy to figure out I just have come up with blanks on both how to accomplish and how to search.  I need to create a subtable of distinct id's from a table that contains those id's with multiple characteristics and if one of those characteristics is not matched the subtable will tell me that.  Rudimentary example below.

IDCHAR_SYS_1CHAR_SYS_2SYSTEM MATCH
1000NNMATCHED
1000BATTBATTMATCHED
1000100100MATCHED
100010/11/201910/11/2019MATCHED
1001NNMATCHED
1001BATTBATTMATCHED
1001201201MATCHED
100109/20/201902/03/2018NOT MATCHED

 

I would want the subtable to look something like this:

IDALL_CHARS_STATUS
1000MATCHED
1001NOT MATCHED

 

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @jason5703 ,

 

Based on your description, create the following measure to get the results you want.

Measure = CALCULATE(MAX('Table'[SYSTEM MATCH]),ALLEXCEPT('Table','Table'[ID]))

V-lianl-msft_0-1600754352223.png

 

 

Best Regards,
Liang
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

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @jason5703 ,

 

Based on your description, create the following measure to get the results you want.

Measure = CALCULATE(MAX('Table'[SYSTEM MATCH]),ALLEXCEPT('Table','Table'[ID]))

V-lianl-msft_0-1600754352223.png

 

 

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

HotChilli
Super User
Super User

In Power Query, do a 'Group By' on ID and aggregate on the MAX of SYSTEM_MATCH column.

 

This works because the N of 'NOT MATCHED' is later in the alphabet than M in 'MATCHED'

I tried the below and the SYSTEM_MATCH column showed every row to be "NOT MATCHED"

 

New Table =
SUMMARIZE (
ALL (Data[ID],Data[DataSystems]),
Data[ID],
"PER_ID_STATUS", MAX(Data[DataSystems])
)
 
The Data[DataSystems] column is calculated and not available in PowerQuery
 
I tried a similar GROUPBY and had the same problem.

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.