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

Filter for Names that don't appear in the current value selection

Hi

 

I would like to be able to filter and show names that do not appear for a certain FY.

I have table below.

 

FYNameDepartment
2021MikeElectric
2021JohanAI
2021JordanNBA
2021BenCartoon
2021ZakesHouse
1920BellaSpace
1920WolverineCartoon
1920BladeMarvel
1920ClarkeDC
1920JohnComputer
1819MikeElectric
1819BladeMarvel
1819BellaSpace

 

Whenever I select the Year eg (FY=1920) on a filter I expect to see the below names

 

Not Submitted for FYNameDepartment
1920MikeElectric
1920JohanAI
1920JordanNBA
1920BenCartoon
1920ZakesHouse

 

I have partly achieved this idea but need now to take it a step further by enabling the selected names be filteltered further and give me their respective record so I can see under which Department etc they belong to.

 

I have used this code to get the below results:

Measure->

No Submissions = CONCATENATEX(FILTER(ALL('Sample'[Name]), NOT[Name] IN VALUES('Sample'[Name])),[Name], " -- ")
 
Before filtering on the FYBefore filtering on FYBefore filtering on FY
After Filtering on FYAfter Filtering on FY
 
 

Any assistance would be greatly appreciated.

 

Regards

 

 

 

2 ACCEPTED SOLUTIONS
v-zhenbw-msft
Community Support
Community Support

Hello @ysf ,

Do you want to display the name and department in a table visual?

If so, we can create two measures to meet your needs.

1. We need to create a table that contains only a different name.

Name table = VALUES('Sample'[Name])

fil1.jpg

2. Then we can create two measures and get the result as well, we need to put the measure in filter on this visual and set it to 0.

Measure = 
var _samplename = VALUES('Sample'[Name])
return
IF(
    MAX('Name table'[Name]) in _samplename,1,0)

Department measure = 
CALCULATE(MAX('Sample'[Department]),FILTER(ALL('Sample'),'Sample'[Name]=MAX('Name table'[Name] )))

fil2.jpg

If you don't meet your requirements, could you show the exact expected result based on the table you shared?

Best regards

Community support team _ zhenbw

If this post helps,then consider Accepting it as the solution to help other members find it faster.

BTW, pbix as an attachment.

View solution in original post

v-zhenbw-msft
Community Support
Community Support

Hello @ysf ,

Do you want to count names that don't appear?

For example, in 1920, it has 5.

If so, it is necessary to create another measure like this,

Count_not_appear =
DISTINCTCOUNT('Name table'[Name]) - DISTINCTCOUNT('Sample'[Name])

Fi1.jpg

Best regards

Community support team _ zhenbw

If this post helps,then consider Accepting it as the solution to help other members find it faster.

BTW, pbix as an attachment.

View solution in original post

5 REPLIES 5
v-zhenbw-msft
Community Support
Community Support

Hello @ysf ,

Do you want to count names that don't appear?

For example, in 1920, it has 5.

If so, it is necessary to create another measure like this,

Count_not_appear =
DISTINCTCOUNT('Name table'[Name]) - DISTINCTCOUNT('Sample'[Name])

Fi1.jpg

Best regards

Community support team _ zhenbw

If this post helps,then consider Accepting it as the solution to help other members find it faster.

BTW, pbix as an attachment.

v-zhenbw-msft
Community Support
Community Support

Hello @ysf ,

Do you want to display the name and department in a table visual?

If so, we can create two measures to meet your needs.

1. We need to create a table that contains only a different name.

Name table = VALUES('Sample'[Name])

fil1.jpg

2. Then we can create two measures and get the result as well, we need to put the measure in filter on this visual and set it to 0.

Measure = 
var _samplename = VALUES('Sample'[Name])
return
IF(
    MAX('Name table'[Name]) in _samplename,1,0)

Department measure = 
CALCULATE(MAX('Sample'[Department]),FILTER(ALL('Sample'),'Sample'[Name]=MAX('Name table'[Name] )))

fil2.jpg

If you don't meet your requirements, could you show the exact expected result based on the table you shared?

Best regards

Community support team _ zhenbw

If this post helps,then consider Accepting it as the solution to help other members find it faster.

BTW, pbix as an attachment.

Hi @amitchandak

Thanks this is just what i needed.

Can you show me also how to retrive a count of the names.

Regards

ysf
Helper I
Helper I

Hi @amitchandak 

Thanks for quick response.

It doesn't return any values. 

 

Regards

amitchandak
Super User
Super User

@ysf , Try a measure like

calculate(CONCATENATEX(FILTER(values('Sample'[Name]), isblank(calculate(count('Sample'[Department])))), " -- "),all('Sample'))

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.