Forum Discussion
Percentage Square Matrix (with Total row)
- 2 years ago
Hi pg1980
See attached PBIX.
I haven't looked closely at other responses so may be repeating things 🙂
Model:
Month Index is the number of months between New & Out plus 1.
Key measures:
Total Quantity = SUM ( 'YourTable'[Quantity] ) Quantity Out Cumulative by Index = VAR MaxIndex = MAX ( 'Month Index'[Month Index] ) RETURN CALCULATE ( [Total Quantity], 'Month Index'[Month Index] <= MaxIndex, NOT ISBLANK ( 'Month Index'[Month Index] ), REMOVEFILTERS ( 'Month Index' ) ) Total Quantity All Index = CALCULATE ( [Total Quantity], REMOVEFILTERS ( 'Month Index' ) ) Net Quantity Cumulative by Index = [Total Quantity All Index] - [Quantity Out Cumulative by Index] Net Quantity Cumulative by Index Previous = VAR MaxIndex = MAX ( 'Month Index'[Month Index] ) RETURN CALCULATE ( [Net Quantity Cumulative by Index], 'Month Index'[Month Index] = MaxIndex - 1, REMOVEFILTERS ( 'Month Index'[Month Index]) ) Percentage = DIVIDE ( [Net Quantity Cumulative by Index], [Net Quantity Cumulative by Index Previous] )
I tried to create as a Measure and as a Calculated table, but it is not working.
As a Calculated table:
please try add table name
- lbendlin2 years ago
Super User
might as well throw my version into the ring.
- lbendlin2 years ago
Super User
You can also see that my totals are off by 1. Can we eliminate the July sample data for now?
- pg19802 years ago
Helper II
it is also not working:
option 1: IF('YourTable'[MonthOffset]=BLANK()
option 2: IF(ISBLANK('YourTable'[MonthOffset])
- pg19802 years ago
Helper II
It's almost there, but the matrix has to repeat the value that doen't have "year-month out"
For example in May ("Year month new") the value 13 has to repeat util the last month.
like this: