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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Mark_Berry12
Frequent Visitor

Count in DAx and exclude data based on criteria

Hello everyone,

 

I am required to provide a count based on which stakeholders own them.
However there are some Packages which are owned by two stakeholders.

I need to count the number of packages which are held exclusivley by stakeholder and present it as a Card. 

So using the data below I would need to see the Packages which are held only by Stakeholder A and not count any packages that are also held by Stakeholder B,C or D. 

So whilst A has a total 12 packages I would want to return 3 being the only packages that are exclusive to them.

 

StakeholderPackage
A1001
B1001
C1002
A3001
A3002
B3004
A3004
B3005
A3005
B3007
A3008
B3008
B3010
B3010
A3011
B3013
A3013
B3014
A3014
B3016
D3016
B3016
D3016
A3017
B3017
A3018
B3018
A3019
B3019
B3020
1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @Mark_Berry12  - you can  create below calculated table and measure as follows:

 

Create a new calculated table :

ExclusivePackages =
VAR UniquePackages =
    ADDCOLUMNS (
        SUMMARIZE ( 'Stapack', 'Stapack'[Package] ),
        "StakeholderCount", COUNTROWS ( FILTER ( 'Stapack', 'Stapack'[Package] = EARLIER ( 'Stapack'[Package] ) ) )
    )
RETURN
    FILTER ( UniquePackages, [StakeholderCount] = 1 )

 

rajendraongole1_0-1738901812685.png

 

 

Create a measure as below:

ExclusivePackageCountA =
VAR PackagesWithOneOwner =
    FILTER (
        SUMMARIZE ( 'stapack', 'stapack'[Package] ),
        CALCULATE ( DISTINCTCOUNT ( 'stapack'[Stakeholder] ) ) = 1
    )
RETURN
    COUNTROWS (
        FILTER ( PackagesWithOneOwner,
            CALCULATE ( MAX ( 'stapack'[Stakeholder] ) ) = "A"
        )
    )
 

rajendraongole1_2-1738902121621.png

 

 

Hope this helps.

 





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

Proud to be a Super User!





View solution in original post

1 REPLY 1
rajendraongole1
Super User
Super User

Hi @Mark_Berry12  - you can  create below calculated table and measure as follows:

 

Create a new calculated table :

ExclusivePackages =
VAR UniquePackages =
    ADDCOLUMNS (
        SUMMARIZE ( 'Stapack', 'Stapack'[Package] ),
        "StakeholderCount", COUNTROWS ( FILTER ( 'Stapack', 'Stapack'[Package] = EARLIER ( 'Stapack'[Package] ) ) )
    )
RETURN
    FILTER ( UniquePackages, [StakeholderCount] = 1 )

 

rajendraongole1_0-1738901812685.png

 

 

Create a measure as below:

ExclusivePackageCountA =
VAR PackagesWithOneOwner =
    FILTER (
        SUMMARIZE ( 'stapack', 'stapack'[Package] ),
        CALCULATE ( DISTINCTCOUNT ( 'stapack'[Stakeholder] ) ) = 1
    )
RETURN
    COUNTROWS (
        FILTER ( PackagesWithOneOwner,
            CALCULATE ( MAX ( 'stapack'[Stakeholder] ) ) = "A"
        )
    )
 

rajendraongole1_2-1738902121621.png

 

 

Hope this helps.

 





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

Proud to be a Super User!





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.

Top Solution Authors