Forum Discussion

jakubk's avatar
jakubk
Icon for Helper I rankHelper I
1 year ago
Solved

dynamic grouping for 'legend' in a viz (map) driven by parameter

Hi all,   I'm trying to create a map which changes the 'category'/legend of the points based on the value in a parameter/slider   I'm aware I can't drag a measure in there and that a calculated c...
  • danextian's avatar
    danextian
    1 year ago

    That should still be possible but you need to specify in the measure that the profit grouping is to be summarized by product and location.

    Sales by Grouping = 
    VAR __TBL =
        ADDCOLUMNS (
            SUMMARIZE ( Sales, Sales[Fruit],Sales[State] ),
            "@Amt", CALCULATE ( SUM ( Sales[Sales] ) ),
            "@Grouping", IF ( CALCULATE ( SUM ( Sales[Sales] ) ) >= [Parameter Value], "Yes", "No" )
        )
    VAR __FILTERED_TBL =
        FILTER ( __TBL, [@Grouping] IN VALUES ( 'Grouping'[Grouping] ) )
    RETURN
        SUMX ( __FILTERED_TBL, [@Amt] )