Forum Discussion

inglexjc's avatar
inglexjc
Post Patron
3 years ago
Solved

Color coding graph based on age.

I was able to get a new table created to group children by ages.

 

 

and was told to create the following measure 

 

Count Age =
VAR __AgeBandMin = SELECTEDVALUE('Query1'[Min] )
VAR __AgeBandMax = SELECTEDVALUE('Query1'[Max])
return
CALCULATE(
    COUNT('Legal Files'[Age]),
    'Legal Files'[Age] >= __AgeBandMin,
    'Legal Files'[Age] <= __AgeBandMax
)
 
But I can't get a graph to create based on ages and being color coded like this:

 

  • Hi inglexjc amitchandak ,
    Just replace the comma with && 'Legal Files'[Age] >= __AgeBandMin &&.

    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
    Nathaniel

11 Replies

  • inglexjc , try like

    Count Age =
    VAR __AgeBandMin = SELECTEDVALUE('Query1'[Min] )
    VAR __AgeBandMax = SELECTEDVALUE('Query1'[Max])
    return
    CALCULATE(
    COUNTX(Filter('Legal Files',
    'Legal Files'[Age] >= __AgeBandMin,
    'Legal Files'[Age] <= __AgeBandMax
    ),'Legal Files'[Age]) )

      • Nathaniel_C's avatar
        Nathaniel_C
        Community Champion

        Hi inglexjc amitchandak ,
        Just replace the comma with && 'Legal Files'[Age] >= __AgeBandMin &&.

        Let me know if you have any questions.

        If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
        Nathaniel