How can I calculate the year-over-year percentage change using custom fiscal week numbers in Power BI Desktop

0 votes
How can I calculate the year-over-year percentage change using custom fiscal week numbers in Power BI Desktop?

I'm working with a Power BI report that follows a custom fiscal calendar with week numbers instead of standard dates. I need to calculate the year-over-year (YoY) percentage change based on these custom fiscal weeks rather than calendar weeks. What is the best approach using DAX to compare data from the same fiscal week in different years? How can I ensure that the calculation correctly accounts for shifting fiscal weeks across years?
3 days ago in Power BI by Evanjalin
• 16,180 points
16 views

1 answer to this question.

0 votes

In Power BI, to evaluate the YoY percentage variation through custom fiscal weeks, one needs to set up the proper fiscal calendar and use the DAX measure to compare different years within the same fiscal week.

Step 1: Create a Custom fiscal calendar table

Here's what your date table should include:

Date column

FiscalYear

FiscalWeekNumber (Week 1 to Week 52)

You can create a custom fiscal calendar in Power Query or DAX if you have not done so already.

Step 2: Create a Measure for YoY Comparison

You can use DAX to derive the current year's fiscal week value of the previous year:

PreviousYearValue = 
VAR CurrentFiscalWeek = SELECTEDVALUE(FiscalCalendar[FiscalWeekNumber])
VAR CurrentFiscalYear = SELECTEDVALUE(FiscalCalendar[FiscalYear])
RETURN 
CALCULATE(
    SUM(Sales[SalesAmount]),  
    FiscalCalendar[FiscalWeekNumber] = CurrentFiscalWeek, 
    FiscalCalendar[FiscalYear] = CurrentFiscalYear - 1
)

Step 3: Calculate the YoY Percentage Change

Now, create a DAX measure for YoY % change:

YoY Change % = 
VAR CurrentValue = SUM(Sales[SalesAmount])
VAR PreviousValue = [PreviousYearValue]
RETURN 
IF(NOT ISBLANK(PreviousValue), 
   DIVIDE(CurrentValue - PreviousValue, PreviousValue, 0)
)

Step 4: Provided Relationships and Filters Are Put on Properly

The Fiscal Calendar table should relate to the fact table (i.e., Sales data).

Instead of calendar week numbers, use the Fiscal Week Number in visuals.

Step 5: Verify the Working with the Table Visual

Put the fiscal year, fiscal week number, and YoY change % measure in a table. Ensure that the comparison accurately aligns fiscal weeks across different years.

answered 3 days ago by anonymous
• 16,180 points

Related Questions In Power BI

+1 vote
2 answers

How can I count the distinct values in a column using Power BI?

In Power BI, use the DISTINCTCOUNT DAX ...READ MORE

answered Nov 26, 2024 in Power BI by Anu
• 2,720 points
412 views
0 votes
1 answer

How can I create advanced custom visualizations using Python in Power BI? Any best practices?

Create a more complex visualization aptly using ...READ MORE

answered Jan 13 in Power BI by pooja
• 16,300 points
96 views
0 votes
1 answer

How can i see my plugin name in the Power BI Visual plugin List ?

there is a couple of errors in your ...READ MORE

answered Nov 8, 2018 in Power BI by Upasana
• 8,620 points
1,524 views
0 votes
1 answer

Using DAX calculation how to calculate monthly budget till today in power bi Desktop?

You can make use of this: MTD Budget ...READ MORE

answered Sep 24, 2020 in Power BI by Gitika
• 65,770 points
1,958 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,501 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,130 points
2,857 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,520 points
1,637 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Yes using Power BI REST API to ...READ MORE

answered Sep 18, 2018 in Power BI by Kalgi
• 52,350 points
1,774 views
0 votes
1 answer

Why am I getting a 401 Unauthorized error when renaming a Power BI dataflow using the Power BI REST API, and how can I fix it?

A 401 Unauthorized error when renaming a ...READ MORE

answered 4 days ago in Power BI by anonymous
• 16,180 points
72 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP