Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Mixing MIN and ALL

Hello,

 

I'm working with a table containing a date column, and I want to get the oldest date in the table date column without being affected by the filters applied in the page.

 

If I create a measure "oldestdate = min(CCR_Consumption[usage_date])", syntax is OK but filters on the page will change the returned value.

 

If I use oldestdate = min(all(CCR_Consumption[usage_date])), I get an error message "The MIN function only accepts a column reference as an argument"

 

Thank you for your help.

 

Laurent

 

 

 

 

  •  

    Anonymous 

     

    Hi, to obtain the MIN

     

    MinDate=CALCULATE(MIN(Table1[yourDateColumn]), ALL(DateTable))

     

    Regards

     

    Victor

3 Replies

  • Vvelarde's avatar
    Vvelarde
    Icon for Community Champion rankCommunity Champion

     

    Anonymous 

     

    Hi, to obtain the MIN

     

    MinDate=CALCULATE(MIN(Table1[yourDateColumn]), ALL(DateTable))

     

    Regards

     

    Victor

    • Anonymous's avatar
      Anonymous
      Not applicable

      Works like a charm. Thank you :)

  • PattemManohar's avatar
    PattemManohar
    Icon for Community Champion rankCommunity Champion

    Anonymous  You can try this as well...

     

    MINX(ALL(CCR_Consumption),CCR_Consumption[usage_date])