Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have posted this question about a week ago, and I thought my manager said "it is good" back then, but yesterday I heard that I need to come up with a solution as below:
But, now bottom is requirement:
This is my previous post , and with following DAX code, I thought it would satisify the requirement from my manager:
ALI1 =
IF (
ISFILTERED ( 'Z-Table'[Location] ),
IF (
CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "ALI" ),
"ALI",
""
),
""
)
FILTER =
IF (
ISFILTERED ( 'Z-Table'[Location] ),
IF ( MAX ( 'tblScore'[Location] ) IN VALUES ( 'Z-Table'[Location] ), 1, 0 ),
0
)
Basically, current DAX works if user selects each selection one by one, but not when selected "Select all".
So, I want those characters ("ALI", "ARB" & "AVI") show up when selected individually as well as selected "Select all".
Is it possible?
Thanks.
Solved! Go to Solution.
You just need to remove the ISFILTERED condition.
ALI1 =
IF (
CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "ALI" ),
"ALI",
""
)
ARB1 =
IF (
CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "ARB" ),
"ARB",
""
)
AVI1 =
IF (
CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "AVI" ),
"AVI",
""
)
FILTER =
IF ( MAX ( 'tblScore'[Location] ) IN VALUES ( 'Z-Table'[Location] ), 1, 0 )
If you want the table visual to show up all the characters if "select all" selected then remove the isfiltered condition. Else keep it as is.
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
|
Hi @JustinDoh1 , When "Select All" is selected, it doesn't actually apply a filter. Instead, it removes all filters, which can make it seem like no specific value is selected. ISFILTERED() function returns FALSE when "Select All" is used because technically, no filter is applied.
However, I would like to suggest you to create a new column in Z-Table named "SelectAll". See image below:
This is for hirarchy. Now create a slicer with the hirarchy. See image below:
Now update the measures, you have created earlier with the following codes:
ALI1 =
IF(
NOT ISFILTERED('Z-Table'[SelectAll]),
"",
IF (
SELECTEDVALUE('Z-Table'[SelectAll]) = "Select All" && SELECTEDVALUE('Z-Table'[Location]) = "ALI",
"ALI"
,
IF(
SELECTEDVALUE('Z-Table'[SelectAll]) = "Select All" && CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "ALI" ),
"ALI",
""
)
)
)
ARB1 =
IF(
NOT ISFILTERED('Z-Table'[SelectAll]),
"",
IF (
SELECTEDVALUE('Z-Table'[SelectAll]) = "Select All" && SELECTEDVALUE('Z-Table'[Location]) = "ARB" ,
"ARB"
,
IF(
SELECTEDVALUE('Z-Table'[SelectAll]) = "Select All" && CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "ARB" ),
"ARB",
""
)
)
)
AVI1 =
IF(
NOT ISFILTERED('Z-Table'[SelectAll]),
"",
IF (
SELECTEDVALUE('Z-Table'[SelectAll]) = "Select All" && SELECTEDVALUE('Z-Table'[Location]) = "AVI",
"AVI"
,
IF(
SELECTEDVALUE('Z-Table'[SelectAll]) = "Select All" && CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "AVI" ),
"AVI",
""
)
)
)
FILTER =
IF (
NOT ISFILTERED('Z-Table'[Location]),
IF(MAX('tblScore'[Location]) IN VALUES('Z-Table'[Location]), 1, 0),
IF (
SELECTEDVALUE('Z-Table'[SelectAll]) = "Select All",
IF (
MAX('tblScore'[Location]) IN VALUES('Z-Table'[Location]),
1,
0
),
0
)
)
And you are done. Check the outputs below, for your understanding:
1. When no selection:
2. When single selections:
3. When 'Select All' is selected :
Hope this helps!!
If this solved your problem, please accept it as a solution and kudos!!
Best Regards,
Shahariar Hafiz
You just need to remove the ISFILTERED condition.
ALI1 =
IF (
CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "ALI" ),
"ALI",
""
)
ARB1 =
IF (
CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "ARB" ),
"ARB",
""
)
AVI1 =
IF (
CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "AVI" ),
"AVI",
""
)
FILTER =
IF ( MAX ( 'tblScore'[Location] ) IN VALUES ( 'Z-Table'[Location] ), 1, 0 )
If you want the table visual to show up all the characters if "select all" selected then remove the isfiltered condition. Else keep it as is.
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
|
@tharunkumarRTK Thank you so much for your help. I am just curious why those extra IF conditions were there at the first place. I am just trying to figure our the logic.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |