Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Rck7
Helper II
Helper II

How to compare past two years data on a clustered column chart by fiscal Year- monthly basis?

Hi Friends,

I have a table with a date column with dates from (27Oct-14 - 26Oct17). I would like to build a clustered column chart with data bars showing the total number of tokens on a monthly basis for the Fiscal Year's (Year1: 27/Oct/14-26/Oct/15,  Year2: 27/Oct/15- 26/Oct/16, Year3: 27/Oct/16- 26/Oct/17) side by side. 

How would I able to create  measures and use them/ if there is any other way to achieve the result?

Glimpse of my data: 

5.png6.png7.png
 
Any help would be appreciated!!!!!!!!!
Thank you.

1 ACCEPTED SOLUTION

Hi @Rck7,

 

I cannot locate to the Query Editor mode in your pbix file as I don't have the valid credential.

 

To show Month name on X-axis is the same. You only need to make some adjustment, please see below:

 

=Date.MonthName([Date])

1.PNG2.PNG

All the other steps are the same.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
chethan
Resolver III
Resolver III
v-yulgu-msft
Employee
Employee

Hi @Rck7,

 

In source table, create two calculated columns:

Year No = Test1[Date].[Year]

FY =
IF (
    IF (
        Test1[Date].[MonthNo] <= 10
            && Test1[Date].[Day] < 27,
        Test1[Year No] - 1,
        Test1[Year No]
    )
        = 2014,
    "Year1",
    IF (
        IF (
            Test1[Date].[MonthNo] <= 10
                && Test1[Date].[Day] < 27,
            Test1[Year No] - 1,
            Test1[Year No]
        )
            = 2015,
        "Year2",
        "Year3"
    )
)

Add corresponding fields into clustered column chart as shown in below screenshot.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft Thank you for your solution. Would you mind explaining/commenting your measure? Does all the measure you have suggested goes in to a one single new column?  I am trying to understand  your measure!! 

Thank you.

Hi @Rck7,

 

First, I get the year number from date column using 

Year No = Test1[Date].[Year]

1.PNG

 

Then, based on this syntax, I created a new column showing fiscal year number.

2014/1/1~2014/10/26 -> Fiscal Year 2014 -> Year1

2014/10/27~2015/10/26 -> Fiscal Year2015 -> Year2

2015/10/27~2016/10/27 -> Fiscal Year2016 -> Year3

 

In short, in a year, the day before 10/26 is calculated into previous fiscal year, the day after 10/27 is considered as current fiscal year. 

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft, Thank you for explaining. I have tried your method of solution and I am able to see the comparision  chart for the years 1,2,3,4.  But, I am facing a problem where the months on x-axis are starting from January-December whereas it should start from october- current month (as the fiscal years starts from Oct to Oct). 

My chart: 


8.png9.png

How would I be able to see the months on x-axis to start from oct- oct ?

Kindly, help!
Thank you.

Hi @Rck7,

 

After you have achieved the result in above post, in Query Editor mode, you need to create some extra columns.

 

Please see stpes as shown in below screenshots.

1.PNG2.PNG

3.PNG

 

Return back to data view, sort the Month column based on [SortCategory].

4.PNG

 

In chart visual, rather than add date hierarchy into X-axis, please add [Month Number] to X-axis. In that case, you can sort the X-axis to starts from Oct to Oct.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft.Thanks for the reply. I have tried what you have suggested but not sure if it is ordered in correct format or not. Addititionally, I want to see the month names instead of the numbers.

I want to build my chart where I could see yearly value bars for (FY1, FY2,FY3)& FY4(whichis going to start from
(27/Oct/17- 26/Oct/18) allingned on x-axis with the months (with names)starting from October to October(which are the fiscal year contract months). 


Kindly, help me with this problem.
Thank you.

Hi @Rck7,

 

I cannot locate to the Query Editor mode in your pbix file as I don't have the valid credential.

 

To show Month name on X-axis is the same. You only need to make some adjustment, please see below:

 

=Date.MonthName([Date])

1.PNG2.PNG

All the other steps are the same.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft 

 

I am very grateful for your instructions on this as it has got me so much closer to my goal on one particular report, but I am experiencing the opposite problem to Rck7--I cannot get my months to display in the right calendar order.

 

months out of order 1.png

 

I need to be able to compare 2019 to 2020 in side by side collumns, and I followed your instructions to create a custom collumn and a Conditional collum, and I can get 2019 and 2020 to compare this way, however, it seems to be placing the collumns in alphabetical order.  I cannot adjust the date hierarchy because my Date/time opened is in the Legend position and only gives me the option for Year.  Month number occupies the Axis but there is no option to sort by the month number, or at least, not that I can see.  Thoughts?

 

months out of order 2.pngmonths out of order 3.pngmonths out of order 4.png

Any advice you could give me would be greatly appreciated.

 

 

 

@v-yulgu-msft. Thank you very much for the help. It worked!!!!!!!!! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.