Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have Data Like,
Fin year | Bill Month | Qty |
2015-2016 | April | 223 |
2015-2016 | May | 308 |
2015-2016 | June | 602 |
2015-2016 | July | 726 |
2015-2016 | August | 527 |
2015-2016 | September | 536 |
2015-2016 | October | 289 |
2015-2016 | November | 406 |
2015-2016 | December | 672 |
2015-2016 | January | 575 |
2015-2016 | February | 784 |
2015-2016 | March | 213 |
2016-2017 | April | 233 |
2016-2017 | May | 193 |
2016-2017 | June | 562 |
2016-2017 | July | 517 |
2016-2017 | August | 531 |
2016-2017 | September | 353 |
2016-2017 | October | 227 |
2016-2017 | November | 249 |
2016-2017 | December | 629 |
2016-2017 | January | 599 |
2016-2017 | February | 600 |
2016-2017 | March | 243 |
Now what i write in measure column to calculate monthwise comparison.
@PKGARG wrote:
I have Data Like,
Fin year Bill Month Qty 2015-2016 April 223 2015-2016 May 308 2015-2016 June 602 2015-2016 July 726 2015-2016 August 527 2015-2016 September 536 2015-2016 October 289 2015-2016 November 406 2015-2016 December 672 2015-2016 January 575 2015-2016 February 784 2015-2016 March 213 2016-2017 April 233 2016-2017 May 193 2016-2017 June 562 2016-2017 July 517 2016-2017 August 531 2016-2017 September 353 2016-2017 October 227 2016-2017 November 249 2016-2017 December 629 2016-2017 January 599 2016-2017 February 600 2016-2017 March 243
Now what i write in measure column to calculate monthwise comparison.
You'll have to re-model your data as below and create a calendar table as @Anonymous suggests.
calendar = ADDCOLUMNS ( CALENDAR ( "2015-04-01", "2018-03-30" ), "Fin Year", IF ( MONTH ( [Date] ) < 4, CONCATENATE ( CONCATENATE ( YEAR ( [Date] ) - 1, "-" ), YEAR ( [Date] ) ), CONCATENATE ( CONCATENATE ( YEAR ( [Date] ), "-" ), YEAR ( [Date] ) + 1 ) ), "YearMonth", CONCATENATE ( CONCATENATE ( YEAR ( [Date] ), "-" ), RIGHT ( CONCATENATE ( "0", MONTH ( [Date] ) ), 2 ) ) )
Then create relationship between those two tables.
Then create two measures like
Previous Month Qty = CALCULATE(SUM(yourTable[Qty]), PREVIOUSMONTH('calendar'[Date])) Previous Year Qty = CALCULATE(SUM(yourTable[Qty]), SAMEPERIODLASTYEAR('calendar'[Date]))
Check more detail in the attached pbix.
I Am Trying to Convert My Data Fin Year & Month in Date. How can i add column for Date by Using...
Fin.Year Month Date
2015-2016 April ?
2016-2017 April ?
2015-2016 May ?
2016-2017 May ?
I would probably do some string munging and use DATEVALUE. Something like:
=DATEVALUE([Month] & " 1," & LEFT([Fin.Year], 4))
You will want to create a date/calendar table, then create a relationship between your data... and the new calendar table. Then you can use function like "SAMEPERIODLASTYEAR".
Hi,
I'm not really sure if I am right.
But for me it looks like a normal job for a pivot table (or matrix in Power BI)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |