Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
I am pretty new in Power BI world. I need a solution to a problem. I want a column (Export/Local) that will change value based on my selection. Let me describe with a photo.
I already have a slicer with country names which filters any rows that has India on it (when India is selected).
The link how I made the slicer is this (https://community.powerbi.com/t5/Desktop/Filter-Rows-with-Visual-Filter/m-p/793145#M381804)
Can someone help?
Solved! Go to Solution.
Should I read this
Selected Country=FO Country=FP Country=Mkt Country> Local FF&P
as
IF
Selected Country=FO Country
AND
FO Country=FP Country
AND
FP Country=Mkt Country
THEN
Local FF&P
???
If so your measure is
ExportLocal=
var co=SELECTEDVALUE(table[Country])
var fo=SELECTEDVALUE(table[FO Country])
var fp=SELECTEDVALUE(table[FP Country])
var mk=SELECTEDVALUE(table[MKt Country])
RETURN
SWITCH(TRUE();
co=fo && fo=fp && fp=mk; "Local FF&";
co=fo && fo!=....I would like to go on with the logic but doesn't make sense to me
...and then close the switch.
You need to rethink the model. The way you're explaining it makes no sense at all. The connected row to Bangladesh is "Bulk Export", not "Local FP". Why is supposed to be Local FP? There is no way for us to understand why you want to show "Local FP". Why not for example "Local FF&P"?
I appologize for failing to make it simpler. I will try again.
Logic for the "Export/Local" column is:
when,
Selected Country=FO Country=FP Country=Mkt Country> Local FF&P
Selected Country=FO Country (not equal to FP & Mkt country)> Bulk Export
Selected Country=FP Country (not equal to FO & Mkt Country)>FG Export
Selected Country= FP Country= Mkt Country(not equal to FO country)> Local FP
Hope this helps
Should I read this
Selected Country=FO Country=FP Country=Mkt Country> Local FF&P
as
IF
Selected Country=FO Country
AND
FO Country=FP Country
AND
FP Country=Mkt Country
THEN
Local FF&P
???
If so your measure is
ExportLocal=
var co=SELECTEDVALUE(table[Country])
var fo=SELECTEDVALUE(table[FO Country])
var fp=SELECTEDVALUE(table[FP Country])
var mk=SELECTEDVALUE(table[MKt Country])
RETURN
SWITCH(TRUE();
co=fo && fo=fp && fp=mk; "Local FF&";
co=fo && fo!=....I would like to go on with the logic but doesn't make sense to me
...and then close the switch.
Thanks a lot. I have created the measure. But how do I put it on a pie chart to show the categories. It does not work when I put the measure on a pie chart.
That wasn't the requirement. If you put it in a pie chart and not a matrix, there is no valid value for the SELECTEDVALUE so it won't work.
Beside that, how can you show a value in a pie chart where there is a single variable while your value is depending on three different variables???
User | Count |
---|---|
124 | |
108 | |
99 | |
62 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |