Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi experts,
my problem is the following one:
I have a map with some locations in power bi, which were sucessfully displayed. Now I would like to use the auto zoom and change the colour of the selected location. The rest of these have to be displayed all the time, too.
So I created the same location table twice and put it into the visual.
Now I need the switch "if the selected value of the location (Lacation Table 1 with the slicer) is equal to the the row of Location2 (second location table) then green, otherwise blue" (At the code shown as Var1 = Location2[Address] ) in a measure to use it in the visual.
But I don't get the right idea. Can you pleas help me😞 (I tried it with calculated and lookupvalue, but it wasn't working)
Measure:
Colour= var Var1 = Location1[Address]
return
switch (true(), 1=2,
Var1 = Location2[Address]
"green","BLUE")
Solved! Go to Solution.
Hi @Do5779 ,
Is this above you want?
If yes, please refer the pbix in the attachment. if no, please provide some example data and expect result.
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-chenwuz-msft: Your report works fine with the countrys, but what if I want e.g. to change countrys to Gross Sales, I dont get the desired result. Fore Example for the gross Sales 1799 only Canada should be green and the rest is blue, but no colour change. My question is because in my fault I have Ids with addresses and this is nearly the same.
(I didn't find the tag to upload the report 🤔)
Here is the solution as a Video, but in my case it wont work.
DAX Fridays! #212: VALUES vs SELECTEDVALUE to conditional format a line chart - YouTube
For a Test I did it how it was explained and it works:
Test4 =
var selectvalue = VALUEs(Abfrage1[id])
return
If(selectedvalue(Tabelle[ID]) in selectvalue, "y" , "n")
but for the real data with the same code:
Test4 =
var selectvalue = VALUEs('Abfrage1'[Index.1])
return
If(SELECTEDVALUE('Member'[Index.1]) in selectvalue, "y" , "n")
I get only "y" as the results...
Hi @Do5779 ,
Is this above you want?
If yes, please refer the pbix in the attachment. if no, please provide some example data and expect result.
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-chenwuz-msft,
yes this should work, but unfortunately there is no attachment. Can you please add it?
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 |
User | Count |
---|---|
9 | |
7 | |
4 | |
4 | |
4 |