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
KJ
Regular Visitor

Power BI report compare multiple rows to find growth percent

Hi,

 

I am new to power BI and trying to figure out things, But dont have time in hand want to design a simple report to show percentage value increased  over time for a resource

 

I am pulling data from sharepoint online list, I got the data in Power BI.

 

This is the sample data in which i have shown 4 items with three enteries on different date, I have 600 items with multiple date enteries. I want to show a bar graph or line graph with date slider on top to show which top 10 items have grown maximum in the selected date period.

 

I have tried to search tutorials and look for similar example but could not find much, Please share explanatory steps as i am not much familiar with functions in power bi.

 

Data Schema.

 

 

SiteJobRunDateValue
A3-Apr-17203050
B3-Apr-171254
C3-Apr-17321
D3-Apr-17444
A10-Apr-17203350
B10-Apr-171294
C10-Apr-17500
D10-Apr-17555
A17-Apr-17205550
B17-Apr-171344
C17-Apr-17800
D17-Apr-17666
   

 

 

Thanks,

KJ 

 

1 ACCEPTED SOLUTION
bblais
Resolver III
Resolver III

I  created a JobRuns table with your sample data in it:

 

First I created measures for the MIN and MAX values.  Because they are measures, they will calculate within a given context, so they should give you MIN/MAX for whatever date range you filter by (and site).  Be careful not to use these without a site filter or they will potentially give you incorrect data:

 

 

Min Site Value = MIN(JobRuns[Value])
Max Site Value = MAX(JobRuns[Value])

 

Now just add a measure to calculate the percent change.  Again, since this is contextual, it will give you the percent change over whatever time period you have sliced:

 

 

Pct Increase = DIVIDE([Max Site Value]-[Min Site Value],[Min Site Value])

 With some formatting, here's a table that shows your percent increases for each site.  To show it works with the date filters, I chose only 4/10 and 4/17:

 

 

Capture.PNG

You could always safeguard it from trying to calculating a percent increase when you don't have specific sites by doing something like this to just return blank if more than one site is chosen. This would work on the MIN/MAX measures too:

 

Pct Increase = IF(HASONEVALUE(JobRuns[Site]),DIVIDE([Max Site Value]-[Min Site Value],[Min Site Value]))

View solution in original post

8 REPLIES 8
bblais
Resolver III
Resolver III

I  created a JobRuns table with your sample data in it:

 

First I created measures for the MIN and MAX values.  Because they are measures, they will calculate within a given context, so they should give you MIN/MAX for whatever date range you filter by (and site).  Be careful not to use these without a site filter or they will potentially give you incorrect data:

 

 

Min Site Value = MIN(JobRuns[Value])
Max Site Value = MAX(JobRuns[Value])

 

Now just add a measure to calculate the percent change.  Again, since this is contextual, it will give you the percent change over whatever time period you have sliced:

 

 

Pct Increase = DIVIDE([Max Site Value]-[Min Site Value],[Min Site Value])

 With some formatting, here's a table that shows your percent increases for each site.  To show it works with the date filters, I chose only 4/10 and 4/17:

 

 

Capture.PNG

You could always safeguard it from trying to calculating a percent increase when you don't have specific sites by doing something like this to just return blank if more than one site is chosen. This would work on the MIN/MAX measures too:

 

Pct Increase = IF(HASONEVALUE(JobRuns[Site]),DIVIDE([Max Site Value]-[Min Site Value],[Min Site Value]))
KJ
Regular Visitor

Thanks for the reply.

 

I have been able to see some thing but still not there yet.

What i have done as you said i have added three measures : Maxsiteval , minsiteval , pctIncrease 

Values column has Siteurl , Maxsiteval , minsiteval , pctIncrease

filter has : Maxsiteval , minsiteval , pctIncrease , siteurl with top 20 

 

I can see the result with max and min values but percentage column is coming zero , trying to figure what did i miss.I did not get what you mean by "Be careful not to use these without a site filter or they will potentially give you incorrect data:"

 

 

Thanks

KJ

 

Can you post an image of your table visual that has all the fields you want, including the % increase field that is showing as 0%? 

KJ
Regular Visitor

Here is the image 

 

BIScreenshot.png

 

Filter only siteurl is not showing in the screen shot, It has a selection of top 20. 

 

Please let me know if you need any more information.

 

Thanks a lot for your help

 

KJ
Regular Visitor

I moved a step further, So i can see the comparision between max and min value.

Now i want is to sort by highest percent increase ( Desc-Asc) but do not see a option to sort the result

Second thing can we change the type showing on the value axis, By default it takes it as Million value , I would want to show it in Megabytes.

Third is the filter on the top lets me select one date not multiple , i have changed the type to date time now it shows as slider

 

 

BIScreenshot1.png

 

 

 

 

Thanks,

KJ

In your stacked area chart, click the ellipses (...) in the upper right-hand corner, and you should be able to choose your pct increase column for sorting.  To sort descending you may need to click and choose the column twice, once to sort ascending and then again to switch to descending.

To change the units on the Y-axis, you can go into the visual properties and change the Y-Axis Display Units value:

 

Capture.PNG

KJ
Regular Visitor

Thanks bblais, all your help is really appretiated mate.

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.