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
Richard_Halsall
Helper IV
Helper IV

Distinct count measure when slicer from a disconnected table

Hi,

 

I have a distinct count measure sitting in a card visual which counts the number of records showing in a matrix.

 

This works perfectly when sliced by filters based on related table fields, however I cannot get it to work when it is sliced by a filter with a value from a disconnected table.

 

The measure I use to show values in a matrix when the disconnected table filter is used is

Selected Flag =

VAR _a =
    SELECTCOLUMNS ( 'Technician Roles', "Slicer", [Technician Role] )
VAR _b =
    ADDCOLUMNS (
        _a,
        "Count",
            SWITCH (
                TRUE (),
                ISBLANK ( MAX ( 'DimContractor'[Job_Title__c] ) )
                    && [Slicer] = "No Certificate", 1,
                MAX ( 'DimContractor'[Job_Title__c] ) <> BLANK ()
                    && CONTAINSSTRING ( MAX ( 'DimContractor'[Job_Title__c] ), [Slicer] ), 1
            )
    )
RETURN
    IF (
        SUMX ( _b, [Count] )>=1
            || NOT ( ISFILTERED ( 'Technician Roles'[Technician Role] ) ),
        1,
        0
    )
 
I have tried and am not able to place this measure as a filter on the card visual
 
Can anybody provide help?
 
Thanks
2 REPLIES 2
amitchandak
Super User
Super User

@Richard_Halsall , the value has pass to one the column of table and connected table.

 

example

https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

 

of like

 

calculate([Measure], filter(Table1, Table1[Column] in values(Table2[Column])  ))

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Hi, please find attached a sample pbix

I am trying to get the Technician Count Unique card to show the correct number of technicians in the matrix

If you select the filters ContractType or EmployeeDesc the Technician Count Unique is correct

If you select the filter Technician Role, individually or in conjunction with the other filters, the Technician Count Unique is incorrect

It is this filter which is driven by data in a disconnected table.

 

The disconnected table is also used in a measure, Selected Flag, to filter the matrix

 

Any help in getting the TechnicianCountUnique measure working would be appreciated.

 

https://we.tl/t-sdrZO73PEW 

 

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!

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