Skip to content

Instantly share code, notes, and snippets.

@random82
Created March 5, 2019 02:02
Show Gist options
  • Save random82/c0397406b9abaca93401666207f8d18c to your computer and use it in GitHub Desktop.
Save random82/c0397406b9abaca93401666207f8d18c to your computer and use it in GitHub Desktop.
Financial year reporting in PowerBI

Step 1 - Generate FY calendar table:

Approvals calendar = CALENDAR(
  IF(
    MONTH(NOW()) <= 6,
      DATE(YEAR(NOW())-1, 7, 1),
      DATE(YEAR(NOW()), 7, 1)
    ),
  IF(
    MONTH(NOW()) <= 6,
      DATE(YEAR(NOW()), 6, 30),
      DATE(YEAR(NOW()) +1 , 6, 30)
    )
)

Step 2 - Create a relationship between date column in source table with the financial year calendar table

Step 3 - Create a column in the calendar table with Year Month labels:

Year Month = FORMAT('Approval calendar'[Date], "YYYY MMMM")

Note: This column is text type and it won't sort properly

Step 4 - Create a dummy column - numeric - to sort Year Month labels:

Year Month Number = YEAR('Approval calendar'[Date]) * 100 + MONTH('Approval calendar'[Date])

Step 5 - Sort Year Month column by the dummy one (pic)

Step 6 - Use the labels column with "Show items with no data" checked on X axis (pic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment