Forum Discussion

VandanaPulluri's avatar
VandanaPulluri
Frequent Visitor
7 years ago
Solved

Dynamic display value

Hi,

 

I have got 4 different datasets with calcualted Mann Kendall P values :

1)  Main Dataset holds complete data

2) P value by Country (R script)

3) P value by Region (R script)

4) P value By Country (R script) and

5) P value by Product (R script); Every dataset has a Product ID for referencing each other.

 

I want to display measure  in Dashbaord based on the selected value eg: If i select a country from a Country filter then the P value need to displyed from the "P value by Country" dataset and same If i select a Region from a Region filter then the P value need to displyed from the "P value by Region" dataset. By dafult I want to disply P value by Product.

 

Please any inputs whould be appreciated.

 

Thank you,

  • TeigeGao's avatar
    TeigeGao
    7 years ago

    Hi VandanaPulluri ,

    Please add blank between VAR and _Selectedvalue in the first line, the Var is a key work, it should be var _SelectedValue rather than VAR_SelectedValue.

    Best Regards,

    Teige

5 Replies

  • VandanaPulluri you can create a measure with Switch function 

     

    Show Measure = 
    VAR __selectedValue = SELECTEDVALUE( CountryTable[CountryTableColumn] )
    RETURN
    SWITCH( TRUE(),
    __selectedValue = "Country", [Country Measure],
    __selectedValue = "Region", [Region Measure],
    [Product Measure]
    )
    
    • VandanaPulluri's avatar
      VandanaPulluri
      Frequent Visitor

      Tried with the below but syntax error.

       

      Measure= VAR__SelectedValue= SELECTEDVALUE(PMS_COMPLAINT_COUNTRY[COUNTRY_ORIGIN_NM])
      RETURN
      SWITCH(TRUE(),
      __SELECTEDVALUE= "COUNTRY_ORIGIN_NM",PMS_COMPLAINT_COUNTRY[MannKendallY],
      __SELECTEDVALUE= "PMS_COMPLAINT_COUNTRY",PMS_COMPLAINT_REGION[MannKendallY], [MannKendallY])
       
      any further suggesstion please...