Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I have 2 tables: Headcount and Country names.
Country names is basically a connection to this page: https://www.worldatlas.com/aatlas/ctycodes.htm, so it has Country Name and 2 letter Code
Headcount... has the 2 letter country Codes, and as you can imagine, it has many rows with the same country code.
I really want to make a slicer that will show Country Names for people to select.... but when I make a slicer with Country Name variable, it shows ALL country names that are listed on the webpage. I'd like it to show ONLY the country names for which I have a code in Headcount table.
edit: I don't think that the sample-dataset provided to me contains ALL the country codes that we have. so if anotehr user has more permissions, then it'd be nice if he could see the data for the countries that is unavailble to me as the maker of the report.
Any suggestions?
Solved! Go to Solution.
Well, one way would be to create a table that did something like:
Slicer Table = VAR __tmpTable = DISTINCT('Headcount'[Code]) RETURN ADDCOLUMNS(__tmpTable,"Country",LOOKUPVALUE('Country'[Country Name],'Country'[Code],'Headcount'[Code]))
Something like that.
Well, one way would be to create a table that did something like:
Slicer Table = VAR __tmpTable = DISTINCT('Headcount'[Code]) RETURN ADDCOLUMNS(__tmpTable,"Country",LOOKUPVALUE('Country'[Country Name],'Country'[Code],'Headcount'[Code]))
Something like that.
I'm noobing something wrong: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
what does this mean?
Hmm, difficult to say. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
That being said, see attached PBIX.
I tried to make a measure instead of a table... (never made Tables before, so didn't even see that option there).
so of course that didn't work, lol.
Thank you very much for your help and your patience Greg!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |