Forum Discussion

RaphaelQueiroz's avatar
RaphaelQueiroz
Frequent Visitor
7 years ago
Solved

How to bring the price between dates?

Hi, I have two tables, one has de prices of my company by iten, the another one has de price of others companies. For example: This is my company table     This is others companies's tab...
  • rafaelmpsantos's avatar
    7 years ago

    This one

    Medida =
    var datamaxima = calculate(LASTDATE(tabelaprecosempresa[DFdata_alteracao]);filter(all(tabelaprecosempresa[DFdata_alteracao]);tabelaprecosempresa[DFdata_alteracao]<=SELECTEDVALUE(tabelaprecosconcorrente[Data Coleta])))
    return
    CALCULATE(AVERAGE(tabelaprecosempresa[DFpreco]);filter(ALL(tabelaprecosempresa);tabelaprecosempresa[DFdata_alteracao]=datamaxima && tabelaprecosempresa[DFcod_item_estoque]=SELECTEDVALUE(tabelaprecosconcorrente[DFcod_item_estoque])))