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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
KC13
New Member

And logic for multiple selections in Slicer

Hello,

I have search throught the community and online for a while, but cannot see to find something that helps me get unstuck with my issue. 

 

My slicer contains 20 customers.  Each customer has a generated forecast over 12 months for various products. 

The goal to visualize would be............if I selected 2 or more customers, show the forecast volume only for the common products between the select customers. 

So far I have only been able to manage the first step of what I have found online with teh Dax formula to count the number of customers selected in the slicer - 

VAR NumofSelectedCatagories=COUNTROWS(VALUES('KEY'[customercode]))
 
THANK YOU
1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi,

 

I assume that you have separate tables for customer and products, and that they have 1:many relationship with the main table, like this

sturlaws_0-1654301727978.png

 

Nex create a measure like this:

measures =
VAR _numberOfCompanies =
    COUNTROWS ( DimCompany )
VAR _products =
    FILTER (
        ADDCOLUMNS (
            CALCULATETABLE (
                VALUES ( DimProduct[ProductID] ),
                FILTER ( DimProduct, NOT ISEMPTY ( 'Table' ) )
            ),
            "numberOfCompaniesPrProduct", DISTINCTCOUNT ( 'Table'[CompanyID] )
        ),
        [numberOfCompaniesPrProduct] = _numberOfCompanies
    )
RETURN
    COUNTROWS ( _products )

 

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

 

How to Get Your Question Answered Quickly

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.