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

Total multiplied by rows in measure

having the following columns :

Capture.PNGThe right column is a measure with the following code:

((sumx('Step6'; hour('Step6'[Times.Time]))+sumx('Step6'; MINUTE('Step6'[Times.Time])/60)) * sumx('Step6';'Step6'[StaffPrice]))
 
The total of Ticket price is totally incorrect sum of all the values of ticket price, why does it multiply the sum of Ticket Price on the number of rows?, how can i change it?
 
Thanks.
1 ACCEPTED SOLUTION
solvisig
Advocate III
Advocate III

Its is due to the scope of the filters.

Try creating a new measure with this check = hasonefilter(somecolumn) and add it to your table to find out which column has filter and not on the total value. 

Then you can wrap your measure for ticket price into if(hasonefilter(filteredcolumn);do something; dosomething else)

see this video as well explaining why this is happening: 
https://www.youtube.com/watch?v=Ka7Ds4EAjNQ

View solution in original post

3 REPLIES 3
themistoklis
Community Champion
Community Champion

@Sharaz

 

Try the following using the values function.

In the values function you need to put the DIMENSION which is in the first column on the table.

It is not visible on your image

 

sumx( VALUES( 'Step6'[DIMENSION] ); CALCULATE(SUM( hour('Step6'[Times.Time])))) + do the same for the other 3 measures

solvisig
Advocate III
Advocate III

Its is due to the scope of the filters.

Try creating a new measure with this check = hasonefilter(somecolumn) and add it to your table to find out which column has filter and not on the total value. 

Then you can wrap your measure for ticket price into if(hasonefilter(filteredcolumn);do something; dosomething else)

see this video as well explaining why this is happening: 
https://www.youtube.com/watch?v=Ka7Ds4EAjNQ

@solvisig thanks for that awesome explanation with a video.

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.