Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

How do I rank a filtered table?

TL;DR: I have an unpivoted table of ads data called 'Ads Shown': 'Attribute' column is the ad name. 'Value' column is either 'Selected', 'Not selected', or 'Missing data', depending on whethe...
  • Anonymous's avatar
    Anonymous
    2 years ago

    I seem to have found a simple solution in my case. What a relief.

     

    The TOPN filter would normally take my [Ad Metric] measure to determine what values to sort by. In this case I only wanted the values for new ads, so I made a new measure that calculates that like so:

    New Ads (Ad Metric) = CALCULATE([Ad metric], FILTER('Ads Shown', [New ads selection logic]))

    And put it in the graph like so:

     

    It's a miracle that the filter argument 'FILTER('Ads Shown', [New ads selection logic])' actually worked. Like, it's logical that it should work, since [New ads selection logic] is just a boolian, so it sort of creates a mask to filter the table by. Maybe my mistake before was writing '[New ads selection logic] = 1'?

     

    But Power BI has this amazing way of not working for very simple obvious things, or making very simple obvious things extraordinarilly difficult. So I'm shocked that it worked.