Forum Discussion
Measure with historical aging data
- 4 years ago
DEFINE MEASURE Accounts[AR Total] = SUM( Accounts[AR] ) MEASURE 'Account Categories'[# Accounts (This Week)] = var CountOfAccountsInSelectedCategories = sumx( 'Account Categories', var LowerEndInclusive = 'Account Categories'[Lower End] var UpperEndExclusive = 'Account Categories'[Upper End] var CountOfAccounts = CALCULATE( DISTINCTCOUNT( Accounts[Relation] ), keepfilters( LowerEndInclusive <= Accounts[Days Open this week] ), keepfilters( Accounts[Days Open this week] < UpperEndExclusive ) ) return CountOfAccounts ) return CountOfAccountsInSelectedCategories MEASURE 'Account Categories'[AR Total (Last Week)] = var ARTotal = sumx( 'Account Categories', var LowerEndInclusive = 'Account Categories'[Lower End] var UpperEndExclusive = 'Account Categories'[Upper End] var AccountsTotal = CALCULATE( [AR Total], keepfilters( LowerEndInclusive <= Accounts[Days Open last week] ), keepfilters( Accounts[Days Open last week] < UpperEndExclusive ) ) return AccountsTotal ) return ARTotal MEASURE 'Account Categories'[AR Total (This Week)] = var ARTotal = sumx( 'Account Categories', var LowerEndInclusive = 'Account Categories'[Lower End] var UpperEndExclusive = 'Account Categories'[Upper End] var AccountsTotal = CALCULATE( [AR Total], keepfilters( LowerEndInclusive <= Accounts[Days Open this week] ), keepfilters( Accounts[Days Open this week] < UpperEndExclusive ) ) return AccountsTotal ) return ARTotal MEASURE 'Account Categories'[# Accounts (Last Week)] = var CountOfAccountsInSelectedCategories = sumx( 'Account Categories', var LowerEndInclusive = 'Account Categories'[Lower End] var UpperEndExclusive = 'Account Categories'[Upper End] var CountOfAccounts = CALCULATE( DISTINCTCOUNT( Accounts[Relation] ), keepfilters( LowerEndInclusive <= Accounts[Days Open last week] ), keepfilters( Accounts[Days Open last week] < UpperEndExclusive ) ) return CountOfAccounts ) return CountOfAccountsInSelectedCategoriesAnd here's the Account Categories table:
Note the intervals are left-closed-right-open. You can have it the other way round but you'll have to adjust the measures. It's easy.
UPDATE:
Still didnt manage to figure this out. Here a bit more description:
I basically want to do what is done in this video:
https://www.youtube.com/watch?v=5_KDJGPjMnI
except for in stead of a slicer i need the values for this week and last weeks Accounts Receivable.
So the table in circled RED in the image for this week AND for last week.
Currently I can do the grouping in calculated columns and make two separate report tables with the grouped data. However I want to have 1 pivot table with the grouping and the AR values of this week AND the AR value sof last week.
Who can help me please? Let me know if I need to explain more or more info is needed.
THANK YOUU!!
- daXtreme4 years ago
Solution Sage
Hi Leggies
This does not seem to be overly complex judging by the video...
Can you please supply example data? I don't want to type everything by hand. There does not need to be a lot of it, just enough to demonstrate that it works correctly. The data can be fake, of course, but feel free to supply whatever you want. As long as it's relevant it's OK.
By the way, it's better to provide a link to a shared file (can be Excel, csv, tab-delim... you name it) instead of pasting something in here. The tables that this site renders are just awful and horrible as if they'd been designed in the XIX century. I wish the administrators of the site provided a better environment for us... and this awful styling has been going on and on and on... What a shame.
Thanks.