Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
Solved! Go to Solution.
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! |
@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
Hi,
You may download my PBI file from here.
Hope this helps.
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! |
@thefunnyenterta Patient Cohort (AND Slicer) - Microsoft Power BI Community
@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?
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
66 |