Forum Discussion
Calculated column in a matrix row
Hello community,
I am seeking help on the following issue. I am working on an overview of missing timesheets and would like to display this in a matrix. The 'rows' contain an Index (Unique per person) and a few other fields (like name and country). The only column is a date from a date table an the value is the status of the timesheet per a date.
Shown as a column, meaning in the row fields of the matrix I'd like to show the number of missing timesheets (so next to the name of a person). For this I created a calculated column:
and here is the matrix:
What causes this and how could I fix it?
Cheers,
3 Replies
- Richard77Resolver I
Dear TheoC,
thank you very much for your reply. Power BI however does not allow me to drag the measure into the row context of a matrix.
The calculated column however only gives back the 1 (as it does a countrow and that row applies) and using the table view it automatically sums per person. Should I include this sum somewhere in my formula?
Cheers,
- TheoCCommunity Champion
Richard77 my apologies. I misunderstood what you are wanting.
In the matrix visual context, the measure is the value, not the row. If you are wanting the sum using your calculated column, you could use "ALLEXCEPT" but again it's in the context of each row of the "Combined" table and won't aggregate dynamically.
For your requirement, using a measure is more appropriate given it calculates dynamically based on the current context of the report, which includes filters, slicers, and the layout of the matrix visual.
If the earlier measure doesn't provide the output you're after, you can give this a go to calculate the values based on the Index:
Measure = SUMX( VALUES ( 'Combined'[Index] ) , CALCULATE ( COUNTROWS ( 'Combined' ) , 'Combined'[Final] = "Missing" ) )