Reply
Highlighted
Frequent Visitor
Posts: 4
Registered: ‎12-04-2018
Accepted Solution

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.

Accepted Solutions
Regular Visitor
Posts: 27
Registered: ‎07-21-2016

Re: Total multiplied by rows in measure

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


All Replies
Regular Visitor
Posts: 27
Registered: ‎07-21-2016

Re: Total multiplied by rows in measure

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

Senior Member
Posts: 277
Registered: ‎04-14-2018

Re: Total multiplied by rows in measure

@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

Frequent Visitor
Posts: 4
Registered: ‎12-04-2018

Re: Total multiplied by rows in measure

@solvisig thanks for that awesome explanation with a video.