Forum Discussion
Isblank if nothing selected on a visual
Hello - You were really close. The measure below works for me. Basically, you should create a separate measure for LastYearPriceIndex with the basic logic of calculating the amount for the prior year (excluding the blank evaluation). Then create another measure which is the one that goes in the visual (example below). You will need to update the table and column name in the SelectedCity variable and also update measure name in the SelectedCalculation variable.
Last Year Price Index for Display = VAR SelectedCity = SELECTEDVALUE( DimTableName[CityColumnName],blank() ) VAR SelectedCalculation = [YourMeasureName] VAR Result = if ( SelectedCity = blank(), blank(), SelectedCalculation ) RETURN Result
5 Replies
- kalkhudaryHelper IV
jennratten That worked like magic 🙂 Quick Question: is there a way that instead of displaying the word (Blank) to keep it with no words just nothing shows up. Curious to know if we can apply something to the dax to make it show nothing in terms of wording or maybe a dash (-)
- kalkhudaryHelper IVActually, I figure it out, just change blank() to "-".Last Year Price Index for Display =VAR SelectedCity = SELECTEDVALUE( Geography[City],blank() )VAR SelectedCalculation = [Last Year Price index]VAR Result = if ( SelectedCity = blank(), "-", SelectedCalculation )RETURNResultThanks so much, you made my day.
- jennrattenSuper User
You are very welcome!!
- jennrattenSuper User
There are a couple of things you can do.
- Add conditional formatting to make the font color the same as the background if the value is equal to 0 or blank.
- Change the return result from blank() to custom text of your choosing.
- jennrattenSuper User
Hello - You were really close. The measure below works for me. Basically, you should create a separate measure for LastYearPriceIndex with the basic logic of calculating the amount for the prior year (excluding the blank evaluation). Then create another measure which is the one that goes in the visual (example below). You will need to update the table and column name in the SelectedCity variable and also update measure name in the SelectedCalculation variable.
Last Year Price Index for Display = VAR SelectedCity = SELECTEDVALUE( DimTableName[CityColumnName],blank() ) VAR SelectedCalculation = [YourMeasureName] VAR Result = if ( SelectedCity = blank(), blank(), SelectedCalculation ) RETURN Result