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

Number of occurences based on filters

Dear all,

 

I've got a problem with showing the duplicated values basesd on filters set in report. What I want to achive is to see how many Point of Sales are beeing providing products by more than 1 distributor based on choosen period & distributors.

 

Let's say I have table:

 

YearDistributorPoS
2018C1PoS1
2018C1PoS2
2018C1PoS3
2018C1PoS4
2018C2PoS1
2018C2PoS3
2018C2PoS4
2018C2PoS5
2018C2PoS6
2018C3PoS3
2018C3PoS4
2018C3PoS6
2018C3PoS7
2018C4PoS1
2018C4PoS3
2018C4PoS5
2018C4PoS7
2018C4PoS8
2019C1PoS3
2019C1PoS4
2019C2PoS1
2019C2PoS3
2019C3PoS7
2019C4PoS1
2019C4PoS3
2019C5PoS1
2019C5PoS4

 

In total 2018 (without filters on Distributors) I would like to see:

 

PoSNb of Distributors
PoS13
PoS21
PoS34
PoS43
PoS52
PoS62
PoS72
PoS81

which means that there are 8 uniques PoS, 2 of them are beeing provided products by 1 distributor, and 6 of them are provided by at least 2 distributors.

 

After setting filter on Distributor C1 & C2 the result would be like this:

PoSNb of Distributors
PoS11
PoS21
PoS32
PoS42
PoS61
PoS71

so there are 6 unique PoS, 4 of them are provided by 1 distributor, and 2 them are provided by at least 2 distributors.

 

Similar with 3 different distributors like C1 & C3 & C4:

PoSNb of Distributors
PoS12
PoS21
PoS33
PoS42
PoS51
PoS61
PoS72
PoS81

 

etc.

 

At first I whought about using calculated column to see which values are unique and which appear multiple times:

So i created mapping column to have date and PoS in one field:

MAP = 'Table1'[Year] & "_" & 'Table1'[PoS]

and then I checked the number of occurances in table

Chkduplicate = CALCULATE(COUNTA(Table1[MAP]);FILTER('Table1';'Table1'[MAP]=EARLIER('Table1'[MAP])))

This result was not something i want to see so it has to be done probbably using measures instead. 

 

Many thanks,

Piotr

2 REPLIES 2
PattemManohar
Community Champion
Community Champion

@Anonymous You can just change the "Distributor" field summarization to "Count(Distinct)" as show below in Values section. If you want to create measure then it will be. Shown both methods in the screenshots.

 

Test235 = DISTINCTCOUNT(Test235MeasureCount[Distributor])

 

image.pngimage.pngimage.pngimage.png

 





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

Proud to be a PBI Community Champion




Anonymous
Not applicable

 

 

 

count = CALCULATE([Test235];FILTER(Table1;[Test235]>1))

 

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.