Forum Discussion

LucaixBolha's avatar
LucaixBolha
Icon for Resolver I rankResolver I
4 years ago
Solved

How to do a new column with string values that come from different segmentations on the same data

Hello! 

 

I have a database going under three different types of segmentation (via slicer/buttons): 

1) The rank selectors on green that I can choose or not to be applied;
2) The pink "Top N" slicer, which allows me to restrain the number of Asset Codes displayed at each one of the four white visuals on the top of the page;
3) The four orange slicers that allow me to restrain values if I want to (what also automatically rearrange the ranks at the four white visuals).

My goal is to generate dynamically (after I choose whichever selections at any or all of the 3 segmentation levels) a table/column/slicer/anything that shows me the Assets Code contained in all white visuals, gathered in one place, just like the table in the blue visual (I applied a filter level to build an example of the final result).

 

Here is the file of the pbix: https://drive.google.com/file/d/1N_g1fl5zkXibp6vNwy9s_oBifJCiGu0n/view?usp=sharing

Does anyone have a clue how to solve this issue?
Tks! 🙏

  

6 Replies

  • Your example uses a combination of filters ( AND ).

    By coincidence it matches the values in the other tables, but what you actually want to achieve is a collection of independent results ( OR ).  You can only do that with a measure that tests for 

     

    [Market Value] > 0 || [Negotiation Volume] > 0 || [P/BV]> 0 || [Volatility] > 0

     

    The ||  is what DAX uses for " OR " .

    • LucaixBolha's avatar
      LucaixBolha
      Icon for Resolver I rankResolver I

      Hi lbendlin , thanks for your answer! Ahh these filters were "leftovers" from an earlier attempt of mine, in fact the reason why it matches exactly the values in the other tables is because I've filtered the Asset List in order to show the selected values, here:


      Using your description, my goal would be an (AND) filter type, like if I told Power Bi to do this:

      "Give me a column that aggregates dynamically the names of the Assets filtered by:
                 - the P/BV ranking (AND);
                 - the ones filtered by the Market Value ranking (AND)
                 - the ones filtered by the Negotiation Volume ranking (AND)
                 - the ones filtered by the Volatility ranking

      I just have no ideia how it could be done with DAX 😅

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Let me repeat - what you need is an OR filter, not an AND filter.