Forum Discussion
Difference from previous date aggregate on graph
Hello world,
I have made this calculation to obtain some specific data
Unapp =
CALCULATE(COUNT('Dim - Sales'[AR Id]),filter('Fact - Receipts','Fact - Receipts'[AR Status]=="UNAPP"))and I create this graph
What i want to get is the difference from previous time aggregation, depending on that the user chose form the drill down
E.G on the current graph it would show for 2019->7k and 2020->-28k , but once the user opens it for month view it would show e.g data for February 2020-data for January 2020
In tableau this is done with difference from previous, over here how can I do it?
Thanks everyone!!
3 Replies
- v-eachen-msftCommunity Support
Hi Anonymous ,
You could add two fields in x-axis: Year and your date column. Then use ISINSCOPE() function to show the result.
[Sum] is the result of every month, [Measure] is the difference from previous year.
Measure = VAR a = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[YEAR] = MAX ( 'Table'[YEAR] ) - 1 ) ) RETURN IF ( ISINSCOPE ( 'Table'[Date] ), [SUM], [SUM] - a )Here is my test file for your reference.
- amitchandakSuper User
Anonymous , you have to create diff between each period and merge then into one measure
using
refer : https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
Or refer last period Employee in https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
- AnonymousNot applicable
To be honest I don't really get how this isinscope would function with the graph/my data.