Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Unexpected behavior with dax formula

I'm trying to break a total goal into daily numbers. With the help og amitchandak I got the following formula:

 

Invest. Planejado/Dia = CALCULATE(SUMX(SUMMARIZE(filter(CROSSJOIN('planejado','dCalendario📆'),'dCalendario📆'[FullDate] >= planejado[data_inicio] && 'dCalendario📆'[FullDate]<= planejado[data_fim]),planejado[ChaveVeiculo],'dCalendario📆'[FullDate],planejado[investimento_plan],planejado[data_inicio],planejado[data_fim]),DIVIDE(planejado[investimento_plan],DATEDIFF(planejado[data_inicio],planejado[data_fim],day)+1)))
 
Unfortunately, I'm not having what I expected, as you can see in the image bellow. The 3rd collumn shows how the number should be in this particular situation, since this particular media has already finished.
 
 
 

I appreciatte any help. 

4 Replies

  • Anonymous , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Do you mean that the return result of measure [Invest. Planejado/Dia]? If yes, what's the correct result? Could you please provide the related calculation logic with examples. Thank you.

    Best Regards
    Community Support Team _ Rena Ruan
    If this post helps, then please consider Accept it as the solution to help the other members find it more.