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.
Hi,
Here's a tricky measure to do, on my client demand.
I have 2 sheets. On each, I have a bar chart with years on absissa.
By default, a text has to appear somewhere saying that years selected are ">= 2020"
If users select one or several years on the bar chart, it has to concatenate the years separated by a comma ("in 2021, 2022" for example)
When do I know that nothing is selected on the bar chart ?
When I use SELECTEDVALUE, it is BLANK() when nothing is selected AND when two or more years are selected.
any others options to detect it ?
Here's my attempt which returns ">=2020" when 2 or more years are selected
Sélection Année =
var concatYEARS = CONCATENATEX ( VALUES ( '#PERIODE_DBT_TVX'[Valeur_lib]), [Valeur_lib], ",")
var selection = SELECTEDVALUE('#PERIODE_DBT_TVX'[Valeur_lib])
return
--attempt 1
SWITCH(TRUE(),
selection = blank(),">= 2020",
"in " & concatYEARS)
Thanks a lot !
Solved! Go to Solution.
Hi @Anonymous
Use ISFILTERED( ) on the column in the slicer. It will only be false when nothing is selected
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Thanks @AlB you rock !
For those who might be interested in, here's how I finished my measure.
Sélection Année =
var concatYEARS = CONCATENATEX ( VALUES ( '#PERIODE_DBT_TVX'[Valeur_lib]), [Valeur_lib], ",")
return
SWITCH(TRUE(),
ISFILTERED('#PERIODE_DBT_TVX'[Valeur_lib]) = FALSE(),">= 2020",
ISFILTERED('#PERIODE_DBT_TVX'[Valeur_lib]), "en " & concatYEARS)
Hi @Anonymous
Use ISFILTERED( ) on the column in the slicer. It will only be false when nothing is selected
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |