Forum Discussion
Multiple filters on the same two columns
- 6 years ago
Hi Laszlo
I see the next solution.
First add new calculated table
Table 2 = DISTINCT(SELECTCOLUMNS('Table';"Domain";'Table'[domain];"Program";'Table'[program]))Next add measure to Table 2 like this
Measure = calculate(DISTINCTCOUNTNOBLANK('Table 2'[Program]);ALLEXCEPT('Table 2';'Table 2'[Domain]))Then you can create visuals for example
So, if Measure = 2, this domain is including both program, if measure=1 - the only.
P.S. in your dataset example i see not only domain5, but domain4 also has attented session from the only program2
Hi Laszlo
I see the next solution.
First add new calculated table
Table 2 = DISTINCT(SELECTCOLUMNS('Table';"Domain";'Table'[domain];"Program";'Table'[program]))Next add measure to Table 2 like this
Measure = calculate(DISTINCTCOUNTNOBLANK('Table 2'[Program]);ALLEXCEPT('Table 2';'Table 2'[Domain]))Then you can create visuals for example
So, if Measure = 2, this domain is including both program, if measure=1 - the only.
P.S. in your dataset example i see not only domain5, but domain4 also has attented session from the only program2
- Laszlo6 years agoMicrosoft Employee
Thanks very much AZ38!
I, implmented and it and got it working, but just so I understand what is happening.
The new table contains the distinct domains in my source table as well as the distinct programs.
The measure I am not 100% sure how it works. It calculates the distinct without blanks entry of the the program column, so far I am good. The ALLEXCEPT fuction ignores all the filters on the domains column and only apply the filter as it relates to programs.
Thnaks,
Laszlo--
- Anonymous6 years agoNot applicable
Is there a JavaScript solution / override for that? 😀
I am using the PowerBI-JavaScript SDK,
the custom visual hierarchy slicer works just fine.
But when i have try to use the Tuple filter in the JS SDK for (multi columns selection) it turns out it is not really supported.
This is the Documentaion urlslicer_Tuple_Filter = { $schema: "http://powerbi.com/product/schema#tuple", target: [ // same table different columns selection {table: "Table A", column: "column A"}, {table: "Table A", column: "column B"} // same table different columns selection ], filterType: 6, // can be int 6 or string 'Tuple' operator: "In", // value for selected columns values: [ [ {value: "111"}, // value for column A {value: "222"}// value for column B ] ] };Thank you! 🙂
here is the lick again: