Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello there!
I would like to ask if, if there are any possibilities to create a measure to select column in the visuals or other ways to change columns based on selected value?
Here is my example:
https://www.dropbox.com/s/llq96jalictauxy/SwitchLanguage.pbix?dl=0
I have the SelectedLanguage measure, which returns the selected value based on a slicer. If I choose Czech language, I want to display Department and Country values in Czech from D_Department and D_Country tables.
Could you, please, help me with it?
Thank you in advance!
Solved! Go to Solution.
Hi @Anonymous ,
You cannot create column "C" based on your measure's value.
Calculated columns are only calculated when you first define them and during a dataset refresh, it will not change by filters, it is a definite value, if you expect the value changes with filter, you can only use a measure.
In a measure, columns cannot be referenced directly, MAX function in a measure can return the current value in the same row of the column.
You can learn more about measures and calculated column in this article: calculated-measures-vs-calculated-columns
And according your provided,you could create a measure like the below:
country1 = IF(SELECTEDVALUE(SwitchLanguage[Language])="English",MAX(F_Workers[Country]),LOOKUPVALUE(D_Country[Czech],D_Country[English],MAX(F_Workers[Country])))
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @Anonymous ,
You cannot create column "C" based on your measure's value.
Calculated columns are only calculated when you first define them and during a dataset refresh, it will not change by filters, it is a definite value, if you expect the value changes with filter, you can only use a measure.
In a measure, columns cannot be referenced directly, MAX function in a measure can return the current value in the same row of the column.
You can learn more about measures and calculated column in this article: calculated-measures-vs-calculated-columns
And according your provided,you could create a measure like the below:
country1 = IF(SELECTEDVALUE(SwitchLanguage[Language])="English",MAX(F_Workers[Country]),LOOKUPVALUE(D_Country[Czech],D_Country[English],MAX(F_Workers[Country])))
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |