Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello,
I'm trying to create a measure that shows the following:
Rotulo_ano =
VAR AnoMax = CALCULATE(MAX('dCalendário'[Ano]),ALL('dCalendário'[Ano]))
VAR AnoSelec = CALCULATE(MAX('dCalendário'[Ano]))
return IF(AnoMax = AnoSelec," até " & AnoSelec, " em " & AnoSelec)
If I don't select any year, it shows me "até" (until in Portuguese) the last year. If I select another year, like 2019, it shows me "em" ("in") that specific year. But if I select the last year, which is 2021, it shows me "até", and I want to show me "in" instead because I'm not selecting the whole period.
Nothing selected:
Nothing selected
2020 selected:
2021 selected:
Is there any way I can tell PBI that when I'm selecting a year, even if it's the latest one, it should show me "em"?
Solved! Go to Solution.
Hi @Anonymous
Use HASONEVALUE or SELECTEDVALUE in your code.
Try this measure:
Rotulo_ano =
VAR AnoSelec = CALCULATE(MAX('dCalendário'[Ano]))
return
IF(HASONEVALUE('dCalendário'[Ano])," em " & AnoSelec," até " & AnoSelec,)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
Hello, @VahidDM.
Thank you for your help. It worked as it should and expected. I'll search a little bit more about the functions you wrote.
Hi @Anonymous
Use HASONEVALUE or SELECTEDVALUE in your code.
Try this measure:
Rotulo_ano =
VAR AnoSelec = CALCULATE(MAX('dCalendário'[Ano]))
return
IF(HASONEVALUE('dCalendário'[Ano])," em " & AnoSelec," até " & AnoSelec,)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |