Forum Discussion

pfprado's avatar
pfprado
Frequent Visitor
10 years ago
Solved

How to get minimum value from range date in DAX

I need to get a calculated measure of the minimum date of a range of values, ie I have a fact table with a date and two measures. When I filter by range date, I need to get the second measure of the minimum date of that range, in the example, the measure 1 of 1st january, something like this:

 

https://db.tt/6jKBPRCr

 

The picture on the left is as I have the data in the fact table, data from the right as they should be when I filter from date (from 1st to 6 january). The measure 1 is added for a group, and measure 2 is the minimum value of the range of dates and must be repeated for each resulting record (highlighted).

 

I would greatly appreciate your help with this.

Thank you for your time

  • BhaveshPatel's avatar
    BhaveshPatel
    10 years ago

    AND AT LAST CREATE A FINAL MEASURE

     

    FINALMeasure = CALCULATE([mymeasure],ALL('fact'[Group]))

     

    This will defintely solve your problem.

3 Replies

  • FIRST CREATE A MEASURE

     

    Sumofmeasure2 = SUM('fact'[Measure 2])

     

    AND ON TOP OF THAT CREATE ANOTHER MEASURE

     

    mymeasure = CALCULATE([Sumofmeasure2],FILTER('fact','fact'[Date]=MIN('fact'[Date])))

     

    IT WOULD SOLVE YOUR PROBLEM IF I TOOK YOUR REQUIREMENTS CORRECTLY.

     

    LET ME KNOW HOW IT GOES.

    • BhaveshPatel's avatar
      BhaveshPatel
      Super User

      AND AT LAST CREATE A FINAL MEASURE

       

      FINALMeasure = CALCULATE([mymeasure],ALL('fact'[Group]))

       

      This will defintely solve your problem.

      • pfprado's avatar
        pfprado
        Frequent Visitor

        Thanks a lot! you really help me