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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
UR982T
Frequent Visitor

% of base year by month

How could I possibly calculate % of base year using 2019 as my base year but on a monthly basis? That is, Jan 2020 / Jan 2019, Feb 20 / Feb 2019, Mar 20 / Mar 19 and so on up to Jan 2021 / Jan 2019? I've done a Measure for 2019 using Sales of 2019 = CALCULATE( [TOTAL SALES], 'Dates'[Year] = 2019] and then Percent of 2019 = DIVIDE( [Total Sales], [Sales of 2019] ), but this only works at the year level. Once I use month on the rows of my table only the monthly values for 2019 are populated and so I don't get a percent of base in 2020 or 2021 as the monthly sales values of those years don't have the corresponding 2019 values next to them in the table. Any ideas how I can accomplish this?

 

As the image below the 2019 monthly values are being repeated against 2020/2021 and tyring to create a visual of % of 2019.

 

Percent of 2019.png

1 ACCEPTED SOLUTION
UR982T
Frequent Visitor

I've changed it to this and it works:

 

Sales of 2019 by Month =
    CALCULATE(
    [TOTAL SALES]
    , FILTER( ALL('Dates'[Date]), 'Dates' [Year] = 2019
    && 'Dates'[Month Number] = MAX( 'Dates'[Month Number])
)

View solution in original post

3 REPLIES 3
UR982T
Frequent Visitor

I've changed it to this and it works:

 

Sales of 2019 by Month =
    CALCULATE(
    [TOTAL SALES]
    , FILTER( ALL('Dates'[Date]), 'Dates' [Year] = 2019
    && 'Dates'[Month Number] = MAX( 'Dates'[Month Number])
)

wdx223_Daniel
Super User
Super User

 Sales of 2019 = CALCULATE( [TOTAL SALES], 'Dates'[Year] = 2019,all(dates))

That gives me the total sales of 2019 against each month. I need the sales value of each month of 2019 paired against its corresponding month in 2020 and 2021. I've shared an excel table to make it clearer!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors