Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

how to make column optional / selective

  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 ...
  • Anonymous's avatar
    Anonymous
    7 years ago

    ryan_mayu

     

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

    VAR amount=sum(""Column"")  to basicaly transfer a column, so i did this 
     
    Bar/Line Value =
    VAR mAamount = SUM('BCI - id 1,3,6,7,8'[mA])
    VAR amount=SUM('BCI - id 1,3,6,7,8'[dBuA])
    return
    IF(selectedvalue(Table1[Units]) ="dBuA", amount,
    IF(selectedvalue(Table1[Units]) ="mA" , mAamount,0
    ))
     
    I created two columns one for each unit that calulated the number correctly. Then the code imports them depending on what is selected. Here are the two calculated columns::
     
    dBuA = IF((NOT('BCI - id 1,3,6,7,8'[Unit] = "dBuA")) , 20 * LOG10('BCI - id 1,3,6,7,8'[RequirementLevel]) + 60  ,
                 'BCI - id 1,3,6,7,8'[RequirementLevel])
     
    mA = IF((NOT('BCI - id 1,3,6,7,8'[Unit] = "mA")), (POWER(10,(( 'BCI - id 1,3,6,7,8'[RequirementLevel] - 60)/20))),
                 'BCI - id 1,3,6,7,8'[RequirementLevel])
    "front end" table to select what unit to display "back end" the table
     
    thanks for the help , hope this explanation is not as confusing