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
Aditi_Saxena
Frequent Visitor

Give an option to select start and end date and calculate percentage growth between them

I have data on quarterly basis (as on these dates 3/31/xx, 6/30/xx, 9/30/xx, 12/31/xx) for 3 years, of multiple companies belonging to 13 different countries and 11 different sectors.
Now we want to give an option to the user to select the start and end date and a country. As per the selection, the values pertaining to that date would be picked, and calculate its growth percentage. The growth percentage would be then populated in a chart.

So, the result would be percentage growth chart for all 11 sectors for the selected country.

The data uploaded looks like this

Aditi_Saxena_0-1668576898295.png

 

I tried different measures but could not get the desired result.

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Aditi_Saxena 

According to your description, you wan to calcuate the its growth percentage. And you need [Date] and [Country] slicer . Right?

Here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1668656917055.png

(2)We can create a measure :

Increasing = var _current_period = SELECTEDVALUE('Table'[Period])
var _current_sector = SELECTEDVALUE('Table'[Sector])
var _last_period =MAXX(FILTER(ALLSELECTED('Table'), 'Table'[Period]<_current_period),[Period])
var _last_value =SUMX( FILTER(ALLSELECTED('Table'), 'Table'[Sector]=_current_sector && 'Table'[Period] = _last_period) , [Value])
return
DIVIDE(SUM('Table'[Value])-_last_value , _last_value)

(3)Then we can put the field we need on the visual and we will meet your need :

vyueyunzhmsft_1-1668656967960.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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-yueyunzh-msft
Community Support
Community Support

Hi , @Aditi_Saxena 

According to your description, you wan to calcuate the its growth percentage. And you need [Date] and [Country] slicer . Right?

Here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1668656917055.png

(2)We can create a measure :

Increasing = var _current_period = SELECTEDVALUE('Table'[Period])
var _current_sector = SELECTEDVALUE('Table'[Sector])
var _last_period =MAXX(FILTER(ALLSELECTED('Table'), 'Table'[Period]<_current_period),[Period])
var _last_value =SUMX( FILTER(ALLSELECTED('Table'), 'Table'[Sector]=_current_sector && 'Table'[Period] = _last_period) , [Value])
return
DIVIDE(SUM('Table'[Value])-_last_value , _last_value)

(3)Then we can put the field we need on the visual and we will meet your need :

vyueyunzhmsft_1-1668656967960.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.