Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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.

 


   

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

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

Anonymous
Not applicable

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

Anonymous
Not applicable

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.

 


   

Anonymous
Not applicable

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.

Anonymous
Not applicable

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.