Forum Discussion
Compare SamePeriod Sale
- 9 years ago
Hi,
In your situation, we aggregate data with two aspects: Date and Location and the data are separate in two tables. So we need two new tables if you didn’t have them.
DateTable = CALENDAR ( DATE ( 2015, 1, 1 ), DATE ( 2017, 12, 31 ) )
Locations = DISTINCT ( UNION ( SUMMARIZE ( '2015-2016', '2015-2016'[Loc_id], '2015-2016'[Loc_State], '2015-2016'[Loc_City] ), SUMMARIZE ( '2016-2017', '2016-2017'[Loc_id], '2016-2017'[Loc_State], '2016-2017'[Loc_City] ) ) )
Then create relationship with the new table. The details are in the picture (upper).
Create three measures with these formula.
Sales2015-2016 = CALCULATE ( SUM ( '2015-2016'[Sale] ), SAMEPERIODLASTYEAR ( 'DateTable'[Date] ) )
Sales2016-2017 = SUM ( '2016-2017'[Sale] )
Sales Compare = ( [Sales2016-2017] - [Sales2015-2016] ) / [Sales2015-2016]
Create report. Actually, your two reports are one due to we can control the period with the date slicer. Please have a try.
Best Regards!
Dale
also i need obtion i can view this report Monthwise, Financial Year Wise, Statewise
ANYONE CAN HELP ME
- v-jiascu-msft9 years agoMicrosoft Employee
Hi,
In your situation, we aggregate data with two aspects: Date and Location and the data are separate in two tables. So we need two new tables if you didn’t have them.
DateTable = CALENDAR ( DATE ( 2015, 1, 1 ), DATE ( 2017, 12, 31 ) )
Locations = DISTINCT ( UNION ( SUMMARIZE ( '2015-2016', '2015-2016'[Loc_id], '2015-2016'[Loc_State], '2015-2016'[Loc_City] ), SUMMARIZE ( '2016-2017', '2016-2017'[Loc_id], '2016-2017'[Loc_State], '2016-2017'[Loc_City] ) ) )
Then create relationship with the new table. The details are in the picture (upper).
Create three measures with these formula.
Sales2015-2016 = CALCULATE ( SUM ( '2015-2016'[Sale] ), SAMEPERIODLASTYEAR ( 'DateTable'[Date] ) )
Sales2016-2017 = SUM ( '2016-2017'[Sale] )
Sales Compare = ( [Sales2016-2017] - [Sales2015-2016] ) / [Sales2015-2016]
Create report. Actually, your two reports are one due to we can control the period with the date slicer. Please have a try.
Best Regards!
Dale
- PKGARG9 years agoHelper I
Ist of All Thanks,
Everything is may be ok, but i visualised data then Sales2015-2016 value not shown in Table and SalesCompare show infinity. When i changed by
Sales2015-2016=sum('2015-2016'[Sale]) its working and SalesCompare Result OK, Now Date Slicer is not Working. Pls see where i wrong....
- PKGARG9 years agoHelper I
Also i want to add Month Slicer to see on Month or Multiple Month Status