Forum Discussion

jessicarocha's avatar
jessicarocha
Helper IV
4 years ago
Solved

Measure containing value only for yesterday

Hi everyone, 

 

I need your help, if you can. I still get confused with ALL, ALLSELECTED, not sure what to use here. 

I would like to visualize in a single table containing what we sold per Region yesterday, what was sold per Region in the current week and what was sold in the current month. When nothing is sold, the field for that particular region should be empty.

 

However, I am struggling already with the first measure. 

In my DB the last data available is from yesterday, therefore I calculate this measure: 

 

Yesterday Amount = CALCULATE(
    SUM('Fact'[Amount]), 
    FILTER('Date','Date'[Date] = MAX('Fact'[Date])
    ))

 

The problem has to do with the context I think. 
I can see that yesterday we only sold to the Region Asia and South America. 


However, when I put in a table together with the Region, I get wrong results for Europe and North America.
In the column named "Yesterday Amount", the fields for these 2 regions should be empty since there were no sales.

Can you please help me?

 

Below there is a link for a dummy example. 
Dummy Power BI example 

Thank you very much.



2 Replies