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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors