Forum Discussion

MichaelHanksSF's avatar
MichaelHanksSF
New Member
2 years ago
Solved

Using a calculated column from a filtered table as the legend of a visualisation

Hello, I have a table ("Events") which has events data linked to individuals with IDs. Events begin on a "Commenced Date" and end on a "Ceased Date". For each event, the age of the individual at the ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi MichaelHanksSF ,

    I have created a simple sample, please refer to my pbix file to see if it helps you.

    Create a date table first, then put the date column into the slicer.

    Table 2 = CALENDAR(DATE(2020,1,1),DATE(2021,12,31))

    Then create a measure.

    Measure = var _1=MAXX(ALLSELECTED('Table 2'),'Table 2'[Date])
    var _2=MINX(ALLSELECTED('Table 2'),'Table 2'[Date])
    return
    CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALL('Table'),'Table'[Commenced Date]>=_2&&'Table'[Commenced Date]<=_1&&'Table'[Age]=SELECTEDVALUE('Table'[Age])))

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.