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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Jinc
Regular Visitor

How to calculate Percentage Increase

Hi, 

I have daily sales data over the years and I am trying to see the yearly sales trend. I am tring to calculate the 

Total revenue as measure 

Previous year revenue as measure 

YOY as measure but while taking the YOY increase or decreasing in the graphical area everthing is blanking out and it shows Error fetching the data for the visual.

Can someone help me on what is the mistake that i am making

1 ACCEPTED SOLUTION

Hi @Jinc 

In the error it's clearly stating that 'Year'[Year ] is not a Date Column, which means it has 2023, 2024, 2025 values basically these are Whole Number data type. 

To achive your requirement please follow the below stpes
1. Create a proper Date table
2. Example of Date Table, you can add your own columns if required.

Date = 
ADDCOLUMNS(
    CALENDAR(MIN('2019-2025 Details'[Date]), MAX('2019-2025 Details'[Date])),
    "Year", YEAR([Date]),
    "Month Number", MONTH([Date]),
    "Month Name", FORMAT([Date], "MMMM")
)

3. Mark it as a Date Table in Power BI, Modeling --> Mark as Date Table --> select the [Date] column.
4. Create separte measures for CY, LY and YoY

Total Revenue = SUM('2019-2025 Details'[Amount])
Revenue Last Year = CALCULATE( [Total Revenue], SAMEPERIODLASTYEAR('Date'[Date]))
YoY Revenue Growth % = DIVIDE([Total Revenue] - [Revenue Last Year], [Revenue Last Year])

 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

View solution in original post

7 REPLIES 7
Jinc
Regular Visitor

@DNMAF Total Revenue = SUM('2019-2025 Details'[Amount in Inr Cr])
Revenue Last Year =
CALCULATE(
    [Total Revenue],
    SAMEPERIODLASTYEAR('Year'[Year ])
)
YoY Revenue Growth % =
DIVIDE(
    [Total Revenue] - [Revenue Last Year],
    [Revenue Last Year]
)
Error- Jinc_0-1762773747390.png

 

Looks like the error message gives the answer. The parameter of SAMEPERIODLASTYEAR must be of type DATE. You should check and change the data type of 'Year'[Year]. 

Hi @Jinc 

In the error it's clearly stating that 'Year'[Year ] is not a Date Column, which means it has 2023, 2024, 2025 values basically these are Whole Number data type. 

To achive your requirement please follow the below stpes
1. Create a proper Date table
2. Example of Date Table, you can add your own columns if required.

Date = 
ADDCOLUMNS(
    CALENDAR(MIN('2019-2025 Details'[Date]), MAX('2019-2025 Details'[Date])),
    "Year", YEAR([Date]),
    "Month Number", MONTH([Date]),
    "Month Name", FORMAT([Date], "MMMM")
)

3. Mark it as a Date Table in Power BI, Modeling --> Mark as Date Table --> select the [Date] column.
4. Create separte measures for CY, LY and YoY

Total Revenue = SUM('2019-2025 Details'[Amount])
Revenue Last Year = CALCULATE( [Total Revenue], SAMEPERIODLASTYEAR('Date'[Date]))
YoY Revenue Growth % = DIVIDE([Total Revenue] - [Revenue Last Year], [Revenue Last Year])

 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

This worked, thanks for the help. I was actually cretaing measure in the wrong table which is the sales table in place of the year table. Thanks again for the codes and the steps

Thank you for the prompt response, for some reason the revenue of last year it showing the same revenue and not of the previous year thus when taking the %age increase it is showing 0% for all years 

Did you follow the same steps what I mentioned ? else you can share sample data of .pbix file by using insert link optionajaybabuinturi_0-1762776448720.pngof any cloud platform.

DNMAF
Resolver I
Resolver I

Hi @Jinc ,

would you like to share your measures and the exact error message? That would help.

Did you check already if your measured work if you assign them to a table or matrix?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors