Forum Discussion
hainguyen28
1 year agoRegular Visitor
Add a row header for matrix
Currently, I have this matrix in power BI that shows different cost elements of different countries in different dates. There are many different cost elements that the use can filter through. ...
MFelix
1 year agoSuper User
Hi hainguyen28 ,
For this you can use a calculation group that will get that value that you need.
Create a calculation group with two calculation items:
Depreciation =
VAR _MaxDate = MAXX(ALLSELECTED(Calendar[Date]))
Return
IF(ISINSCOPE(dCalendario[Data]), BLANK(),
CALCULATE([Depreciation], Calendar[Date] = _MaxDate))
Other Elements = SELECTEDMEASURE()
Now add the measure that you want to have on the other columns and apply the calculation item to the columns of your matrix:
The matrix must only have the measure that you want to have detail by day do not add any other metric the calculation group will return the correct measure for depreciation.
hainguyen28
1 year agoRegular Visitor
Hi MFelix,
Thanks for replying. I am trying to replicate your code; however, I don't understand what dCalendario[Data] means in your code.
This is how my data table looks like:
"Depreciation" and "CAPEX" are all under "Cost Element".
What would be equivalence of your code using my table?