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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
bvsaicharitha
Helper I
Helper I

Sorting and Calculation

Hi,

 

I have a data with multiple products, year, month and the values.

 

I want to plot the line graph showing the % growth of value from Jan to Feb for each year and product as a filter Can you help with code or the measure I need to use for the graph. 

 

Power BI.PNG

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @bvsaicharitha,

 

Do you want to get the %change like below?

 

Untitled.png

 

If you want to get the %change above, you could refer to the measures below.

 

Jan = CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Month number]=1&&'Table1'[Year]=MAX('Table1'[Year])))

Feb = CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Month number]=2&&'Table1'[Year]=MAX('Table1'[Year])))

%change = DIVIDE([Feb]-[Jan],[Jan])

If you need additional help, please share the output you desired.

 

In addition, you could have a reference of Measures – Month to Month Percent Change.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @bvsaicharitha,

 

Do you want to get the %change like below?

 

Untitled.png

 

If you want to get the %change above, you could refer to the measures below.

 

Jan = CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Month number]=1&&'Table1'[Year]=MAX('Table1'[Year])))

Feb = CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Month number]=2&&'Table1'[Year]=MAX('Table1'[Year])))

%change = DIVIDE([Feb]-[Jan],[Jan])

If you need additional help, please share the output you desired.

 

In addition, you could have a reference of Measures – Month to Month Percent Change.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.