Hey guys
How are you all doing? Safe and healthy? Hope so.
Is there a way of a measure do something like this:
VAR Measure 1 = 25000
VAR Measure 2 = 27500
VAR Measure 3 = 30000
RETURN
Switch ( True (),
Selected value (year) = “2018”, Measure 1,
Selected value (year) = “2019”, Measure 2,
Selected value (year) = “2020”, Measure 3,
Selected value (year) = “”, “”,) )
Don’t have to be like this, i just thought it should be.
The idea is to know what was the year value selected in the filter.
Thank you all
Pedro
P.S. one more thing: although my visual shows the numbers by month this one will show only once, maybe in the total…
Just a minor change in the formula, instead of hard-coding the Year you can mention the Year column from the dates tables. And at the end you can just replace it with “BLANK()” function or simply write it as 0 if no year is selected. Or else you can also mention that if no year is selected show the default value as “Measure1”.
And another thing is you sure that you want to hard-code the figures because those are just the static numbers. Just few hours back I’ve posted the solution where our member hard-coded the numbers and was not able to slice and dice.
You can just check out the post. Providing the link below for the reference. Hoping your case is absolutely different than the one provided.
Hey guys, you’re are the best and very fast!!! I almost did it on my own!!!
First, thank you so much for all your answers, and 2nd, this measure, is suppose to show only once, in my year visual (as i’ve asked in my P.S. text) I want to see all the numbers, from Jan to Aug, but this one (it’s a kind of a tax a company has for their business, you know @Harsh ) it will show once, or if it’s too hard, divided by the number of months selected, BUT ALWAYS the value chosen above.
Thank you all