cancel
Showing results for
Search instead for
Did you mean:
Frequent Visitor

## Total multiplied by rows in measure

having the following columns :

The 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

Accepted Solutions
Regular Visitor

## 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

3 REPLIES 3
Regular Visitor

## 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

New Contributor

## 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

## Re: Total multiplied by rows in measure

@solvisig thanks for that awesome explanation with a video.