Forum Discussion
How to create measure?
- 6 years ago
Anonymous -
Does this accomplish your request?
MeasureRed = CALCULATE ( [Measure], ALL ( FactSales ), Colour[Colour] = "Red" ) - 6 years ago
What's happening is that, looking at the first line in your "both fields" example,
Cross is filtering out 4 rows from factsales
then red filters, from within those rows, one row of red...whose amount is 6, which is what you see in your table.
So as well as getting All() from the color table, you need to get ALL() from the fact table
something like
MeasureRed = CALCULATE( [Measure];ALL(FactSales); FILTER(ALL(Colour); Colour[Colour] = "Red" ) )
What's happening is that, looking at the first line in your "both fields" example,
Cross is filtering out 4 rows from factsales
then red filters, from within those rows, one row of red...whose amount is 6, which is what you see in your table.
So as well as getting All() from the color table, you need to get ALL() from the fact table
something like
MeasureRed = CALCULATE( [Measure];ALL(FactSales); FILTER(ALL(Colour); Colour[Colour] = "Red" ) )
- Anonymous6 years agoNot applicable
kentyler wrote:MeasureRed = CALCULATE( [Measure];ALL(FactSales); FILTER(ALL(Colour); Colour[Colour] = "Red" ) )
Thank you. This is exact what I want.