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
Anonymous
Not applicable

Month over month change with fiscal calendar

Hi,

 

Can anyone help. I'm unable to display month over month change for my sales data. i've used an invoked fiscal calendar due to sales starting in October however when trying to visualise the mom change it doesn't show it in the fiscal order. 

Capture2.PNG

Capture1.PNG

  

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

I suggest you to create a Dimdate table with Fiscal Year and sort you need.

Date = 
VAR _BASIC =
    ADDCOLUMNS (
        CALENDAR ( DATE ( 2020, 10, 01 ), DATE ( 2022, 09, 30 ) ),
        "Year", YEAR ( [Date] ),
        "Month", MONTH ( [Date] ),
        "MonthName", FORMAT ( [Date], "mmmm" ),
        "YearMonth",
            YEAR ( [Date] ) * 100
                + MONTH ( [Date] )
    )
VAR _ADD =
    ADDCOLUMNS ( _BASIC, "Fiscal Year", IF ( [Month] >= 10, [Year] + 1, [Year] ) )
VAR _ADDRANK =
    ADDCOLUMNS (
        _ADD,
        "Rank",
            RANKX (
                FILTER ( _ADD, [Fiscal Year] = EARLIER ( [Fiscal Year] ) ),
                [YearMonth],
                ,
                ASC,
                DENSE
            )
    )
RETURN
    _ADDRANK

Create a relationship between Date columns.

1.png

Sort MonthName column by Rank and add rank into Tooltip, then sort visual by rank.

2.png

Best Regards,
Rico Zhou

 

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

6 REPLIES 6
Anonymous
Not applicable

Hi @amitchandak 

 

That's correct. The line graph is being sorted by the fiscal calendar as i'd like however the bar chart is being sorted chronologically despite the month order being sorted fiscally.

 

I think it may be due to the mom change calculation but not sure how to rectify it.

amitchandak
Super User
Super User

@Anonymous , You have to create order column for your month

 

Month Order =

if(month([Date]) >9 , month([Date])  -9 , month([Date])  +3 )

 

mark this column as a sort column for the month

 

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

Anonymous
Not applicable

Hi @amitchandak 

 

Many thanks for your help. I've used one of these that has helped me with the attached image however whenever i try to do a month to month sales change it automatically reverts to chronological order instead of fiscal order.

 

Any ideas would be greatly appreciated.

Capture3.PNG

@Anonymous , I think you talking about bar visual, make sure you sort on month using three dots

Anonymous
Not applicable

Hi @amitchandak 

 

That's correct. The line graph is being sorted by the fiscal calendar as i'd like however the bar chart is being sorted chronologically despite the month order being sorted fiscally.

 

I think it may be due to the mom change calculation but not sure how to rectify it.

Hi @Anonymous ,

 

I suggest you to create a Dimdate table with Fiscal Year and sort you need.

Date = 
VAR _BASIC =
    ADDCOLUMNS (
        CALENDAR ( DATE ( 2020, 10, 01 ), DATE ( 2022, 09, 30 ) ),
        "Year", YEAR ( [Date] ),
        "Month", MONTH ( [Date] ),
        "MonthName", FORMAT ( [Date], "mmmm" ),
        "YearMonth",
            YEAR ( [Date] ) * 100
                + MONTH ( [Date] )
    )
VAR _ADD =
    ADDCOLUMNS ( _BASIC, "Fiscal Year", IF ( [Month] >= 10, [Year] + 1, [Year] ) )
VAR _ADDRANK =
    ADDCOLUMNS (
        _ADD,
        "Rank",
            RANKX (
                FILTER ( _ADD, [Fiscal Year] = EARLIER ( [Fiscal Year] ) ),
                [YearMonth],
                ,
                ASC,
                DENSE
            )
    )
RETURN
    _ADDRANK

Create a relationship between Date columns.

1.png

Sort MonthName column by Rank and add rank into Tooltip, then sort visual by rank.

2.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.