https://www.youtube.com/watch?
v=klQAZLr5vxA
Measure is calculated at report level not at current row level OR
on aggregate of values
,where as column is calculated at current row level
SUM(Order[Price]): it works only with one column.
SUM(Order[Price]*Orders[Quantity]) It is not Valid.
For solving this:
1. Either have calculated columns and then SUM function
2. User SUMX or iterator function
<<X>> function
SUMX starts from row 1 and it iterates to the all the rows of Table.
RELATED works on many side to one side relationship because you need to
grab single value to the related table like in below image.
It works on any chain which works as many-to-one, many-to-one
But if we wated to compute the other way means one-to-many relationship then
it will count all the rows and Keyword RELATED should be used.
Question:- How many sales has been done for each given product?
Question: For every product the amount sold?
Note:- Even if multiple unmatched rows in Sales Table only one blank row will be
created in Product table.
w.r.t. above image scenario having blank rows
COUNTROWS (ALL (Product[ProductId]) ): 4 (includes blank row)
COUNTROWS (DISTINCT (Product[ProductId]) ): 3 (excludes blank row)
COUNTROWS (VALUE (Product[ProductId]) ): 4 (include blank row)
COUNTROWS (ALLNOBLANKROW (Product[ProductId]) ): 3 (exclude blank
row)
Filter returns ProductCategory that has more than 10 product
Final output will be:
Sales of the given category means
Sales of the ProductCategory that has more than 10 product
Calculated Tables are