Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I've a table with ID, Names and Day column as under :
ID | Name | Days |
1 | A | 30 days or less |
1 | A | 30 days or less |
1 | A | 30 days or less |
1 | A | 31 to 60 days |
2 | B | 30 days or less |
2 | B | 31 to 60 days |
2 | B | 61 to 90 days |
2 | B | 61 to 90 days |
3 | C | 90+ days |
3 | C | 61 to 90 days |
Alongside I've two slicers, coming from two different tables with such one column each
What I'm trying to do here is, based on the user slicer selection, I want the table to be filtered and only output "Name" that arent present in the first slicer selection, also the anti-join needs to be done on the ID column
So for the above slicer selection, viz. 30 days or less compare with 31 to 60 days, the results should be a table with column "Name" and just record "C" as its the only Name thats not present in the "30 days or less" but present in "31 to 60 days"
Solved! Go to Solution.
Is this what you are looking for?
If so, the model is set up like this:
One benefit of using this method is that you can multi-select in the slicers.
To calculate the compliant names, you can use this in your measures or to filter a table using the "filters on this visual" in the filter pane (see first image):
Name selected (but not in exlcuded) =
VAR _select = CALCULATETABLE(VALUES('Fact'[Name]), TREATAS(VALUES('Date range selection'[Range Selection]), 'Fact'[Days]))
VAR _Exclude = CALCULATETABLE(VALUES('Fact'[Name]), TREATAS(VALUES('Date range Exclude'[Range to be exlcuded]), 'Fact'[Days]))
RETURN
COUNTROWS(EXCEPT(_select, _Exclude))
If you wish to list the names in a card visual for example, or in a column in a table/matrix, use:
Names Identified =
VAR calc = CALCULATETABLE(VALUES('Fact'[Name]), FILTER('Fact', [Name selected (but not in exlcuded)] = 1))
RETURN
CONCATENATEX(calc, 'Fact'[Name], ", ")
The slicers are set up so that once you make a selection in the "Range Selection" slicer, the corresponding ranges are hidden in the "Range to be excluded" slicer (since you cannot select and exclude the same range simultaneously)
I've attached the PBIX file for your reference
Proud to be a Super User!
Paul on Linkedin.
Is this what you are looking for?
If so, the model is set up like this:
One benefit of using this method is that you can multi-select in the slicers.
To calculate the compliant names, you can use this in your measures or to filter a table using the "filters on this visual" in the filter pane (see first image):
Name selected (but not in exlcuded) =
VAR _select = CALCULATETABLE(VALUES('Fact'[Name]), TREATAS(VALUES('Date range selection'[Range Selection]), 'Fact'[Days]))
VAR _Exclude = CALCULATETABLE(VALUES('Fact'[Name]), TREATAS(VALUES('Date range Exclude'[Range to be exlcuded]), 'Fact'[Days]))
RETURN
COUNTROWS(EXCEPT(_select, _Exclude))
If you wish to list the names in a card visual for example, or in a column in a table/matrix, use:
Names Identified =
VAR calc = CALCULATETABLE(VALUES('Fact'[Name]), FILTER('Fact', [Name selected (but not in exlcuded)] = 1))
RETURN
CONCATENATEX(calc, 'Fact'[Name], ", ")
The slicers are set up so that once you make a selection in the "Range Selection" slicer, the corresponding ranges are hidden in the "Range to be excluded" slicer (since you cannot select and exclude the same range simultaneously)
I've attached the PBIX file for your reference
Proud to be a Super User!
Paul on Linkedin.
Create a measure like this plot againt name
if(countx(Tables[Days])+0 =0, 1, blank())
or
Table like
except(all(Table[name]), allselected(Table[Name])
and measure like
countrows(except(all(Table[name]), allselected(Table[Name]) )
Hi @amitchandak ,
I seem to be getting blank values, alos
I'm not concerned about the counts, I'm more interested in getting the names that are present on the table fitered from second slicer but not present in the table filtered from the first slicer
@dollarvora ,Can you share a sample pbix after removing sensitive data.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
107 | |
70 | |
70 | |
43 |
User | Count |
---|---|
148 | |
106 | |
104 | |
89 | |
65 |