Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Retaining certain values so they can be compared against

Hello,

I'm trying to get certain values to remain within a chart with others being optional to add or remove via a slicer.

My data looks like this:

AreaData 1

Data 2

Data 3
Fixed area 11233253221343245
Fixed area 2321435226343221512
Fixed area 332434232532
optional area 1324532546233253
optional area 23422342332432423

 

Is it possible to keep fixed areas 1, 2 and 3 to remain so the user cannot remove them while optional areas 1 and 2 can be changed?

 

Thanks in advance for your help!

  • Hi Anonymous, try this: https://drive.google.com/file/d/1-2UHhq7J4C5Y0csqQCrr3nJMhX12DJVt/view?usp=sharing

     

    Add a new flag to identify the fixed areas and add a new table for just the optional area values, then use the 'Show Area' measure as a 'greater than 0' filter on your visual:

    Show Area = 
    CALCULATE(
    COUNTROWS('Table')
    ,
    'Table'[Fixed Flag] = TRUE()
    ||
    ISFILTERED('Optional Area'[Optional Area]) = TRUE()
    &&
    'Table'[Area] IN ALLSELECTED('Optional Area'[Optional Area])
    , 'Table'[Area] = SELECTEDVALUE('Table'[Area])
    )

     

    Feels fairly wonky, but if it works, it works. Remember to lock and hide the filter, so it can't be removed.

4 Replies

  • Hi Anonymous, try this: https://drive.google.com/file/d/1-2UHhq7J4C5Y0csqQCrr3nJMhX12DJVt/view?usp=sharing

     

    Add a new flag to identify the fixed areas and add a new table for just the optional area values, then use the 'Show Area' measure as a 'greater than 0' filter on your visual:

    Show Area = 
    CALCULATE(
    COUNTROWS('Table')
    ,
    'Table'[Fixed Flag] = TRUE()
    ||
    ISFILTERED('Optional Area'[Optional Area]) = TRUE()
    &&
    'Table'[Area] IN ALLSELECTED('Optional Area'[Optional Area])
    , 'Table'[Area] = SELECTEDVALUE('Table'[Area])
    )

     

    Feels fairly wonky, but if it works, it works. Remember to lock and hide the filter, so it can't be removed.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much! Is there any way you could share the pbix file? I'm struggling to replicate