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

help on percentage change

hi all

I am trying to calculate the annual percentage change & need help here.

This is my data source.

 

How can I create the total sales for Product A from 2015-2018.
I have about 100+ products. Can anyone advice me?

1.PNG

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You source data is little different with the one in previous post, I've made some transform to make sure the consistency. you can use the date column as slicer, filter the 2015-2018, the total will change accordingly. 

Alternatively, you can use the measure by @AlB :

0001.PNG

Pbix attached. 

Community Support Team _ Dina Ye
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

5 REPLIES 5
AlB
Super User
Super User

Hi @Anonymous 

 

1. Place Table1[Product] in the rows of a table visual

2. Create this measure and place it in the visual

 

Measure =
VAR YearsToShow_ = { 2015, 2016, 2017, 2018 }
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        YEAR ( Table1[Date] ) IN YearsToShow_
)

 

You can also do this by just setting slicer on year and Product and filter what you need

 

Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

Anonymous
Not applicable

@AlB 

so if i have 100+ product, i would need to do it for every product?

would there be an easier way?

 

 

Sure. Like I said, you can use slicers on Product and Year. If you place Product on the rows of a matrix visual and the measure in the previous post you'll get the total 2015-2018 for each product, one per row.

 

Anonymous
Not applicable

@AlB 

I'm quite new to power bi and still lost.

would you mind elaborating more on the slicer?

Here the excel file.

https://gofile.io/?c=1WhGvV

 

Thank so much in advance

Hi @Anonymous ,

 

You source data is little different with the one in previous post, I've made some transform to make sure the consistency. you can use the date column as slicer, filter the 2015-2018, the total will change accordingly. 

Alternatively, you can use the measure by @AlB :

0001.PNG

Pbix attached. 

Community Support Team _ Dina Ye
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.