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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jgaard
Frequent Visitor

Adding a visual, (count distinct) filter to all visuals

Hi 

 

I have a visual that is showing data on missing software updates. 

The count is distinct

jgaard_1-1648462846952.png

 

Very basic table looking something like this: 

ComputerNamePatchName
ComputerAPatchA
ComputerAPatchB
ComputerAPatchA
ComputerBPatchG
ComputerCPatchF
ComputerCPatchA
ComputerDPatchH
ComputerDPatchI
ComputerEPatchA


It gives me this wonderful little table visual:

jgaard_2-1648463433253.png

 

I then limit the data with a filter removing all with just one patch awaiting: 

jgaard_3-1648463635238.png

jgaard_4-1648463817979.png

 

And that works on my table visual. But I need it to work on all my visuals on that page. 

My problem is figuring out how to use that filter or creating a measure that works like my filter on alle the visuals on that page. 

 

Kind regards JGaard

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@jgaard,

 

Measures can't be added as page filters, so you have two options.

 

Option 1

 

Add a visual filter to each visual. This will ensure that any user-specified filters (e.g., slicer) are included in the filter context. You can rewrite the measure to correctly calculate totals:

 

Count of PatchName = 
SUMX ( VALUES ( Table1[ComputerName] ), CALCULATE ( DISTINCTCOUNT ( Table1[PatchName] ) ) )

 

DataInsights_0-1648477837577.png

 

Option 2

 

Create a calculated column and add it as a page filter. This approach will not include any user-specified filters in the filter context, however.

 

Count of PatchName Col = 
CALCULATE (
    DISTINCTCOUNT ( Table1[PatchName] ),
    ALLEXCEPT ( Table1, Table1[ComputerName] )
)

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@jgaard,

 

Measures can't be added as page filters, so you have two options.

 

Option 1

 

Add a visual filter to each visual. This will ensure that any user-specified filters (e.g., slicer) are included in the filter context. You can rewrite the measure to correctly calculate totals:

 

Count of PatchName = 
SUMX ( VALUES ( Table1[ComputerName] ), CALCULATE ( DISTINCTCOUNT ( Table1[PatchName] ) ) )

 

DataInsights_0-1648477837577.png

 

Option 2

 

Create a calculated column and add it as a page filter. This approach will not include any user-specified filters in the filter context, however.

 

Count of PatchName Col = 
CALCULATE (
    DISTINCTCOUNT ( Table1[PatchName] ),
    ALLEXCEPT ( Table1, Table1[ComputerName] )
)

 





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

Proud to be a Super User!




Option 2 works like a charm. 😉 

Thank you very much. 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.