Forum Discussion
Get Slicer Selected Items in Calculated Table
Hi,
Using PBID Aug 2024.
How to get a list of slicer selected items in a calculated table?
The same slicer exists in different pages in report.
How does Calculated Table know which slicer/page I am referring to?
Hierarchy Slicer : 'Date Table'[Year], 'Date Table'[QQYY]
Thanks,
-w
Thanks parry2k
Converted to Measure and returning the correct result : 2
Thanks,
wCount of selected items =
Var T1 =
CALCULATETABLE(
VALUES('Calendar'[Quarter]),
ALLSELECTED('Calendar'[Quarter])
)
RETURN
COUNTROWS(T1)
6 Replies
- parry2k
Super User
UncleLewis you cannot create a dynamic table based on the slicer selection.
- tecumseh
Resolver III
Hi parry2k ,
I have a date hierarchy slicer
2024
|-Q1'24
|-Q2'24
|-Q3'24
|-Q4'24
2023
|-Q1'23
|-Q2'23
|-Q3'23
|-Q4'23
etc.... through 2016
User may select any combination of values
How can I capture what the user selected into a Calculated table (Testing) or Virtual Table (Production)
How dows either table know the difference if the same slicer is in use on multiple pages in the report?
1 Page the user selected 2024
On another page the user selected 2023
Thanks,
-w
- UncleLewis
Responsive Resident
Sorry parry2k ,
Let me try again with a screenshot and a pbix.
Here is a sample DAX Formula I tried in a calculated table
It is returning 4 quarters instaed of the 2 selected in the slicer
I've tried several variations of the formula. They all lead to incorrect results or error messages.
PBIX is here
Thanks,
-w - UncleLewis
Responsive Resident
Thanks parry2k
Converted to Measure and returning the correct result : 2
Thanks,
wCount of selected items =
Var T1 =
CALCULATETABLE(
VALUES('Calendar'[Quarter]),
ALLSELECTED('Calendar'[Quarter])
)
RETURN
COUNTROWS(T1)