Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Mix and Max in an IF

Hello,   I have a date table with all dates from 2017-2021.   I'd like to add a slicer for the "Year", and then use whichever values are selected to create a calculated column to flag if a row fal...
  • v-kelly-msft's avatar
    v-kelly-msft
    5 years ago

    Hi Anonymous ,

     

    Create 2 measures as below:

    _Revenue GBP min = 
    CALCULATE(SUM('Invoices'[Revenue GBP]),FILTER(ALL(Invoices),'Invoices'[Year]=MINX(ALLSELECTED('Comp Years'),'Comp Years'[Year])))
    _Revenue GBP max = 
    CALCULATE(SUM('Invoices'[Revenue GBP]),FILTER(ALL(Invoices),'Invoices'[Year]=MAXX(ALLSELECTED('Comp Years'),'Comp Years'[Year])))
    

    And you will see:

     

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!