Forum Discussion

DanCasSan's avatar
DanCasSan
Icon for Helper V rankHelper V
6 years ago
Solved

Use measure as filter

Hello community!   Could someone guide me a little with this case? I am working on a measure as a filter to show a bar comparison, but what happens if I choose more than one option in the filter? I...
  • PaulDBrown's avatar
    PaulDBrown
    6 years ago

    DanCasSan 

     

    Following MFelix  idea of a measure table, if you need multiple selection, you can create a measure for each calculation along the lines of (This example is with my measures):

     

     

     

    Sales 2018 (sel) = 
    VAR calc = CALCULATE(DISTINCTCOUNT('Select Measure'[Selected Measure]);
        FILTER('Select Measure';
        'Select Measure'[Selected Measure]= "Sales 2018"))
        RETURN
        IF(ISBLANK([Countrows Select Measure]); 
            BLANK() ;
                IF(calc= 1; [Sales 2018]; 
                    BLANK()))

     

     

     

     

    Which gets you this:

     

    Attached is the PBIX file: