cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
u986483 Helper I
Helper I

Dynamic Column

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. 

Untitled.jpg

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User I
Super User I

Re: Dynamic Column

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.

 


   





Did I answer your question? Mark my post as a solution!

PLEASE follow these instructions to ask your questions!


Proud to be a Super User!




View solution in original post

5 REPLIES 5
Super User I
Super User I

Re: Dynamic Column

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"?





Did I answer your question? Mark my post as a solution!

PLEASE follow these instructions to ask your questions!


Proud to be a Super User!




u986483 Helper I
Helper I

Re: Dynamic Column

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

Super User I
Super User I

Re: Dynamic Column

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.

 


   





Did I answer your question? Mark my post as a solution!

PLEASE follow these instructions to ask your questions!


Proud to be a Super User!




View solution in original post

u986483 Helper I
Helper I

Re: Dynamic Column

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.

Super User I
Super User I

Re: Dynamic Column

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???





Did I answer your question? Mark my post as a solution!

PLEASE follow these instructions to ask your questions!


Proud to be a Super User!




Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors