Forum Discussion
Anonymous
5 years agoNot applicable
More Filter Options
Hi, I Connected my SQL Database to PwerBi and Joined a Few Tables. Now the Table Contains to an ID a Questions and a Answers. I want to Display ONLY the IDs where the Answer of a Questions is "Ja"...
- 5 years ago
More Screen Shot Examples:
fhill
5 years agoResident Rockstar
Ok, give this a try....
In line with the last post, we still need to create a Table of Selected (Slicer) Q & A Combined Values:
Calculated Column on Original Data Table
Q and A = 'Table'[Questions] & " - " & 'Table'[Answers]
(Modeling Tab -> New Table / And
slicer table = VALUES('Table'[Q and A])
Now we create several meausre again on the Original Data Table:
(I changed the delimiter to a Pipe charcter instead of Comma, use whatever character works for your data...)
Selected Symptoms = CONCATENATEX(ALLSELECTED('slicer table'),'slicer table'[Q and A]," | ")
(Count of Selected Symptoms from the Slicer Table - Will be used to compare later)
Selected Count = DISTINCTCOUNT('slicer table'[Q and A])
(If this ROW of Question - Answer combination was FOUND in the Selection / Slicer Table)
Found = CONTAINSSTRING([Selected Symptoms], FIRSTNONBLANK('Table'[Q and A],""))
(By UID / Name, SUM Found matches) P.S. Likly, some of these Measures could be combined together, I just work in small steps...
UID Symtop Count = CALCULATE( COUNT('Table'[Name]), FILTER('Table', [Found] = TRUE()))
(Last, Final Check comparing the Count of Symptoms Selected to the FOUND / Matching Questions & Answer combinations BY Name / UID)
FINAL CHECK = IF( [Selected Count] = [UID Symtop Count], "Matches All Conditions")
Make sure your 'results visual' Filters 'Final Check' not to be Blank, and ***** You can select any Data Column that's the SAME for every UID, but I had to use 'Selected Symptoms' in the visual instead of the indivudal Question & Answer Columns, because anything that would result in more than 1 row per UID/Name will throw off the 'Final Check' Filter logic...
Hope this helps, or at least gets you closer to your solution.
FOrrest
fhill
5 years agoResident Rockstar
More Screen Shot Examples: