Hello. I’m trying to understand the transition context of an article I’ve seen. These are two tables, one calendar and the other with sales.
The measures are as follows:
1-Total sales = SUM (sales [Amount]) – Total sales of the day
2-LD Sales Good =
CALCULATE ([Total sales];
FILTER (ALL (‘ Calendar ‘);
‘ Calendar ‘ [Day] = MAXX (‘ Calendar ‘; ‘ Calendar ‘ [Day])-1)))
Total sales of the previous day
3-LD Sales BadA =
CALCULATE ([Total Sales];
FILTER (ALL (‘ Calendar ‘);
‘ Calendar ‘ [Day] = CALCULATE(MAXX (‘ Calendar ‘; ‘ Calendar ‘ [Day])-1)))
I’ve added the Calculate function to study how it modifies the row context and transforms it into a filter context.
4-LD Sales BadA =
CALCULATE ([Total Sales];
FILTER (ALL (‘ Calendar ‘);
‘ Calendar ‘ [Day] = CALCULATE (MAXX (‘ Calendar ‘; ‘ Calendar ‘ [Day]))))
It’s similar to the previous measurement, only that I’ve removed (-1).
I developed a visual guide to understand the operation of these measures for the sole purpose of studying the same, but I can not understand how it works LD Sales BadA, and LD Sales BadB. I wish I could complete this guide with these examples.
The measures are as follows:
1-Total sales = SUM (sales [Amount]) – Total sales of the day
2-LD Sales Good =
CALCULATE ([Total sales];
FILTER (ALL (‘ Calendar ‘);
‘ Calendar ‘ [Day] = MAXX (‘ Calendar ‘; ‘ Calendar ‘ [Day])-1)))
Total sales of the previous day
3-LD Sales BadA =
CALCULATE ([Total Sales];
FILTER (ALL (‘ Calendar ‘);
‘ Calendar ‘ [Day] = CALCULATE(MAXX (‘ Calendar ‘; ‘ Calendar ‘ [Day])-1)))
I’ve added the Calculate function to study how it modifies the row context and transforms it into a filter context.
4-LD Sales BadA =
CALCULATE ([Total Sales];
FILTER (ALL (‘ Calendar ‘);
‘ Calendar ‘ [Day] = CALCULATE (MAXX (‘ Calendar ‘; ‘ Calendar ‘ [Day]))))
It’s similar to the previous measurement, only that I’ve removed (-1).
I developed a visual guide to understand the operation of these measures for the sole purpose of studying the same, but I can not understand how it works LD Sales BadA, and LD Sales BadB. I wish I could complete this guide with these examples.