- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

# how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-02-2019 06:20 AM

Hello, so I have a line graph. on the y-axis is a set of data set by a spesific unit. I would like to be able to switch from the current unit of data to a diffrent unit of data, is there a way to change over without editing in the visualizations tab under " Values". Currently I have created two columns that convert the data to one unit or the other manualy .

End goal is to let the user choose what units they would like to see the data presented in , ex: inches or cm.

All help is great! thanks.

- Collin

Solved! Go to Solution.

Accepted Solutions

## Re: how to make column optional / selective

[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-03-2019 09:54 AM - edited 01-03-2019 09:57 AM

Ok , so i figured it out! it was way more simple that what we were trying. I noticed you were using

*Column""*) to basicaly transfer a column, so i did this

All Replies

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-02-2019 06:37 AM

I created two tables to test.

measure = VAR meterchangerate=CALCULATE(SELECTEDVALUE(Sheet10[CHANGE RATE]),FILTER(Sheet10,Sheet10[UNIT]="meter")) VAR decimetre=CALCULATE(SELECTEDVALUE(Sheet10[CHANGE RATE]),FILTER(Sheet10,Sheet10[UNIT]="decimetre")) VAR cm=CALCULATE(SELECTEDVALUE(Sheet10[CHANGE RATE]),FILTER(Sheet10,Sheet10[UNIT]="cm")) VAR amount=sum(Sheet9[AMOUNT]) return if(SELECTEDVALUE(Sheet10[UNIT])="meter",amount*meterchangerate,if(SELECTEDVALUE(Sheet10[UNIT])="decimetre",amount*decimetre,if(SELECTEDVALUE(Sheet10[UNIT])="cm",amount*cm)))

You can create a measure and filter unit to change the value.

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-02-2019 08:06 AM

Thankyou for the responce, it kind of makes sense, but how exectly are you doing your calculations to go from 2 to 20.

the calculations im using are alittle more complex, here are the two i need.

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-02-2019 08:21 AM

2 or 20 depends on what unit you choose. That's why you see two tables. One is created for unit conversion. You stored all the units in that table. It will automatically pick out the corresponding conversion rate when end users choose one unit.

Will the number of 20 will changed in your DAX? Maybe you can modify the coding like something below

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-02-2019 12:18 PM

Hello, not sure if you saw my last post but I have figured some things out. my only and final question is for your CHANGE RATE column you have a number. I need to use my equasion

20 * LOG10( 'BCI - id 1,3,6,7,8'[RequirementLevel]) + 60 |

I tried putting this in place for the column "Change Rate" but it does not display. here are some pictures.

this is the code that works

Here is one table

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-02-2019 10:57 PM

Is '20*LOG10('BCI-ID1,3,6,7,8'[RequirementLevel])+60' a measure?

please try below coding. Thanks

Value =

VAR dBua=20*LOG10('BCI-ID1,3,6,7,8'[RequirementLevel])+60

VAR mA=POWER(10,(('bci-id1,3,6,7,8'[RequirementLevle])

if(selectedvalue(Table1[units])="dBua", amount*dBua,if(selectvalue(Table1[units]="mA", amount*ma))

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-03-2019 05:46 AM

The VAR will not let me refrence the column, is there a dax formula maybe to put it inside that would make it work?

thanks - Collin

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-03-2019 06:59 AM

Could you please some sample data? I am not quite sure what's the difference between my example and your data.

How you get the '20*LOG10('BCI-ID1,3,6,7,8'[RequirementLevel])', I am not familar with that.

What I have provided you is the coding in measure. You can try it by creating a measure.

Thanks

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-03-2019 07:49 AM

yes, sorry . the '20*LOG10('BCI-ID1,3,6,7,8'[RequirementLevel])' is the equasion to go from mA to dBuA and vice versa for the other direction, the example where you have 1, 10 , 100 is where i need these equasions. in your example your changing units by factor of 10 or 100 , im changing by these equasions

mA to dBuA - 20 * LOG10('BCI - id 1,3,6,7,8'[RequirementLevel]) + 60

dBuA to mA - POWER(10,(( 'BCI - id 1,3,6,7,8'[RequirementLevel] - 60)/20))

the 'BCI - id 1,3,6,7,8'[RequirementLevel] is simply my column of data ( your "Amount column" in your example)

Side Note :: the data entered into the column is a mix of dBuA and mA , do I need to change all the default data to one or the other for this to work

Requirment Level | Unit |

106 | dBuA |

100 | dBuA |

90 | dBuA |

90 | dBuA |

106 | dBuA |

106 | dBuA |

106 | dBuA |

100 | dBuA |

20 | mA |

60 | mA |

60 | mA |

33.3333 | mA |

100 | mA |

100 | mA |

66.6666 | mA |

200 | mA |

200 | mA |

90 | dBuA |

90 | dBuA |

106 | dBuA |

106 | dBuA |

here is a sample of data

the data is mixed for ease of user adding data

thanks.

## Re: how to make column optional / selective

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-03-2019 08:41 AM

I am not sure I understand your scenario clearly.

I create a column to converse all the unit to one. For example, I choose dBua

dBuA = if(Sheet19[unit]="dBuA",Sheet19[requirement level],20*LOG('Sheet19'[requirement level])+60)

Then you just create a unit table which only has mA and eBuA in order to filter your data.

change = if(SELECTEDVALUE(Unit[Unit])="dBuA",[amount],POWER(10,(([amount]-60)/20)))