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
thefunnyenterta
Frequent Visitor

List of customer who bought ALL selected columns



custoemr.PNG

Hello! 
With the help of a slicer (or/and a filter), I would like to have the list of customers who are in different columns. For example, If in a slicer I select the major 2 - Bieber and the minor SHADE, I would like to have the list of customers who bought both of those categories (AND logic instead of OR logic). In this case, the list of clients would only consist of customer A. Thank you. 

I put a power bi file as an example. 

help 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1676597280973.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

6 REPLIES 6
smpa01
Super User
Super User

@thefunnyenterta  with the current structure, I don't think you can utilize the slicer from the same table.

 

I solved it by utilizing a disconnected slicer table for major and minor

 

__major+minor = 
VAR major =
    SUMMARIZE (
        FILTER ( 'Table', ( 'Table'[Major] ) IN ( VALUES ( slicerMajor[Major] ) ) ),
        'Table'[Customers]
    )
// VAR debuggerOne =
//     TOCSV ( major, -1, "," )
VAR minor =
    SUMMARIZE (
        FILTER ( 'Table', ( 'Table'[Minor] ) IN ( VALUES ( slicerMinor[Minor] ) ) ),
        'Table'[Customers]
    )
// VAR debuggerTwo =
//     TOCSV ( minor, -1, "," )
VAR inner =
    UNION ( major, minor )
// VAR debuggerThree =
//     TOCSV ( inner, -1, "," )
VAR val =
    MAXX ( inner, [Customers] )
RETURN
    val

 

 

smpa01_0-1676603318831.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1676597280973.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Greg_Deckler
Super User
Super User

@thefunnyenterta Patient Cohort (AND Slicer) - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thank you for the quick reply. However, in my case the categories are in multiple columns as you can see in my explanation. Maybe I'm not clear enough. Will the solution you provided work in my scenario ? Thanks !

 

@thefunnyenterta Would take some tweaking. Can you post your sample data as text and maybe an example of the expected output given some selections?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.