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
Anonymous
Not applicable

Extracting from a column based on another column

Hello!

My table is the following:

Product IDICD Number
1I45
1I46
1 
2I45
3I46
4 

 

My desired output should be the following.

4

 

So the second table should only contain the product numbers that have no ICD number assocated with it which is Product ID 4 in this case.

 

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

According to my understanding, you want to display the Product ID whose ICD Number is blank, right?

 

You could use the following formula:

ICDFlag =
IF ( ISBLANK ( SELECTEDVALUE ( 'Table'[ICD] ) ), 0, 1 )
sumFlag =
IF (
    CALCULATE (
        SUMX ( 'Table', [ICDFlag] ),
        ALLEXCEPT ( 'Table', 'Table'[Product ID] )
    ) = 0,
    1,
    0
)

My visualization looks like this:

8.26.5.1.png

Is the result what you want? If you have any questions, please upload some data samples and expected output.

Please do mask sensitive data before uploading.

 

Best Regards,

Eyelyn Qin

amitchandak
Super User
Super User

@Anonymous , try like

selectcolumns(filter(summarize(table, table[Product ID], "ICD",calculate(count(Table[Product ID]),not(isblank(Table[ICD Number])))
, "ICD1",calculate(count(Table[Product ID]),isblank(Table[ICD Number]))), isblank([ICD]) && not(isblank([ICD1]))) ,"Product ID",[Product ID])

ryan_mayu
Super User
Super User

@Anonymous

you can try to create a new table

Table 2 = 
var tbl=SUMMARIZE('Table','Table'[productID],"COUNT",CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[ICD Number]<>"")))
return SELECTCOLUMNS(FILTER(tbl,ISBLANK([COUNT])),"productID",'Table'[productID])

1.PNG





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

Proud to be a Super User!




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.