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
caseski
Helper I
Helper I

Sum rows corresponding to the same date and divide for number of days

Hi all,

 

I’m new to Power BI and above all I’m a novice in the use of powerQuery and dax and having no programming knowledge I cannot solve simple problems.

Now I'm trying to create a measure that allows you to sum values in the rows of a column corresponding to the same day and that divides by the number of days.

I try to explain myself better with a simplified table:

 

name

time

quantity

A

1/6/21 8.30

3,2

A

1/6/21 8.45

3,1

A

1/6/21 8.50

2,9

A

1/6/21 8.52

3,2

B

2/6/21 9.18

2,5

B

2/6/21 9.30

2,8

B

2/6/21 9.35

2,7

A

2/6/21 9.51

2,9

A

2/6/21 9.55

2,8

A

2/6/21 9.58

3,3

 

(time include also hours minutes and seconds)

 

The results is:

 

A = 21,4 / 2

Where:

21,4 = sum of quantity

2 = number of days

 

B = 8 / 1

 

I’d like also filter by months and name in order to visualize the total quantity for each name in every different month.

 

Thank you in advance

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @caseski 

I am not sure if I understood your question correctly, but please check the below picture and the sample pbix file's link down below.

 

Picture8.png

 

Result Measure =
SUM ( 'Table'[quantity] ) / COUNTROWS ( VALUES ( 'Table'[Date] ) )
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi, @caseski 

I am not sure if I understood your question correctly, but please check the below picture and the sample pbix file's link down below.

 

Picture8.png

 

Result Measure =
SUM ( 'Table'[quantity] ) / COUNTROWS ( VALUES ( 'Table'[Date] ) )
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.