Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Ok , so i figured it out! it was way more simple that what we were trying. I noticed you were using
@Anonymous
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.
Proud to be a Super User!
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.
@Anonymous
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
Proud to be a Super User!
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
@Anonymous
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))
Proud to be a Super User!
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
@Anonymous
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
Proud to be a Super User!
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.
@Anonymous
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)))
Proud to be a Super User!
Ok , so i figured it out! it was way more simple that what we were trying. I noticed you were using
Hi @Anonymous,
It seems that you have solved your problem, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
Best Regards,
Cherry
@Anonymous Glad to hear that. You are welcome.
Proud to be a Super User!
Sorry to confuse you, i am using the Unit column to display on a graph,
so basicaly the chart that you created is good, but I need it to affect the graph as well.
I can manualy change the graph by putting the corresponding column in the " values" slot. but I need a way to have a user do that same thing once the page is published.
Sorry to make this difficult, im trying to learn as I go.
greatly appreciate the help!
- Collin
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |