Forum Discussion

Balogh1Bence's avatar
Balogh1Bence
Helper II
5 years ago

how to get unfiltered values

i am using host.applyJsonFilter provided by powerbi to filter my visual and other visuals on the report.

I have 4 values in my filter:

  • apple
  • orange
  • kiwi
  • banana

than I filter my visual and the other visuals.
Now i only have these:

  • apple
  • banana

how can I access the unfiltered data?

8 Replies

  • dm-p's avatar
    dm-p
    Super User

    Hi Balogh1Bence,

    It's hard to determine the exact nature of your issue without any code or data to confirm behaviour, but visuals only get the data provided to them by Power BI based on what you have specified in the capabilities, as well as any filter context that may be applied.

    So (if I've understood this properly), if you're asking the filter manager to filter your own visual, Power BI will only provide this filtered data back to your data view - you should be able to confirm this by using Performance Analyzer to observe the query your visual is running and checking the results in a tool like DAX Studio. This will likely confirm the reduced dataset you're seeing.

    If you are looking to have all data available in your visual to work with, then you will likely need to avoid filtering your own so that Power BI does not reduce it down. I would probably approach this by tracking which items were being filtered by my visual in its view model (e.g. with a boolean property or similar) so that I could determine whether to show/hide or dim this data (or whatever you are trying to achieve) so that it's still available to work with for subsequent operations.

    If this doesn't answer your question, please provide more information on what you are trying to do, with any supporting code (including capabilities so that we can understand the data view mapping) and I might be able to provide a more targeted answer.

    Regards,

    Daniel

    • Balogh1Bence's avatar
      Balogh1Bence
      Helper II

      hiding and showing values based on the filters does not realy work, because the value of the totals will be incorrect. I realy hoped there is an API or some kind of variable, method or request I could use to access the unfiltered values. Its a matrix and i need all the headers for creating the filters.

      • dm-p's avatar
        dm-p
        Super User

        The only way to do this currently if you're using a matrix data view mapping,  would be to enable supportsHighlight in your capabilities and use the selection manager rather than the filter API. Power BI will provide any results back as a corresponding highlights array and you can compare these to the original values and update your visual accordingly.

        If this isn't sufficient, then it's probably best speaking to the team directly for advice - [email protected]

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Balogh1Bence,

    I think there should more suitable processing on power bi 'edit interaction' feature instead of integrating them into custom visual.

    Change how visuals interact in a report - Power BI | Microsoft Docs

    You may need to 'overwrite' basic filter interfaces and add some condition parameters or options to control its status if 'custom visual' provides the customizable of these interfaces. (they should more simple process on interaction options)

    Regards,

    Xiaoxin Sheng