Forum Discussion

RobbyLorenz3004's avatar
RobbyLorenz3004
Regular Visitor
2 years ago
Solved

Compare values

Hello everyone, I have two tables (KPI and KPI_current day. Each table contains the respective date and time. Example: Column A = date and column B = 01:00:00. Column C contains integers. I would no...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for the reply fromfahadqadir3, please allow me to provide another insight:

    HI,RobbyLorenz3004 

    Regarding the issue you raised, my solution is as follows:

    1.First I have created the following table and the column names and data are the data you have given:

    2. Below are the measure I've created for your needs:

     

    Measure = 
    var predate=SUM('Table'[date])-1
    var prevalue=CALCULATE(SUM('Table'[values]),FILTER(ALLSELECTED('Table'),'Table'[date]=predate&&'Table'[time]=MAX('Table'[time])))
    RETURN SUM('Table'[values])-prevalue

     

    3.Here's my final result, which I hope meets your requirements.

     

     

     

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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