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

Percentage growth hour for hour

Hi.

 

I have a dataset with sales different times a day which could look like below.

 

Udklip.PNG


I made a colum with the simple dax HOUR(), that make all sales between 0-1 to hour '0' so i could get a visualization of the total sales pr hour in a table/matrix.

 

Udklip1.PNG


So we have a total sales of 600 in the first hour (0) and a total sales of 900 in the second hour (1), which give a growth on 50%.
My problem is that i cant figure out how to get the percentages growth pr hour like shown above in a table/matrix.

Anyone with a solution to this?

 

In advance thanks.

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @Anonymous ,

Based on my test, you could refer to below formula:

Growth in Percentange = var a=[Hour]-1
                      var b=CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Hour]=a))
                      return IF(b=0,BLANK(),([Sales]-b)/b)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
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

3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @Anonymous ,

Based on my test, you could refer to below formula:

Growth in Percentange = var a=[Hour]-1
                      var b=CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Hour]=a))
                      return IF(b=0,BLANK(),([Sales]-b)/b)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-danhe-msft It's fixed, thank you!

Anonymous
Not applicable

Hi @v-danhe-msft,

 

Is it possible to simplify my dateset like yours, with only one value of hour 0, 1, 2 and so on, because i in my dataset i have a lot of values of each, its only inside my repport that its simplified to one value of each. I tried to imply your formula, but seems like it doesnt work when the data isnt in one value.

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.