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

Measure total incorrect

Hi everybody,

 

I am aware that there are hundreds of posts on the topic "total of measure is incorrect" and I have read most of them. Yet, I cannot solve a rather simple issue:

Equipment NameDaysDaily RentRent x Days (var )Rent x Days (isfiltered)Rent x Days (Hasonefilter)
Equipment 150.522.582.582.58
Equipment 256.4532.2632.2632.26
Equipment 353.2316.1316.1316.13
TOTAL  6.4512.9012.90
 

Rent x Days (Hasonefilter) = 

if(
HASONEFILTER(time_entries[Equipment Name (from Gsheet)]),
[Dias Operativos Measure] * [Arriendo diario],
sumx(time_entries,
[Dias Operativos Measure] * [Arriendo diario]))
 

Rent x Days (var) = 

VAR __table = SUMMARIZE(time_entries, time_entries[Equipment Name (from Gsheet)], "__value", [Operativo x Arriendo diario])
RETURN
IF(HASONEVALUE(time_entries[Equipment Name (from Gsheet)]), [Operativo x Arriendo diario], SUMX(__table,[__value]))

 

Rent x Days (Isfiltered) = 

if(
ISFILTERED(time_entries[Equipment Name (from Gsheet)]),
[Operativo x Arriendo diario],
sumx(all(time_entries), [Dias Operativos Measure] * [Arriendo diario]))
 
I have slicers for a date and client names which may have to do with the issue at hand. If anybody could help me getting a correct sum on this measure would be VERY much appreciated. I am on this for 2 days now. 
 
Thanks a million!
Sven
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Measure total incorrect

What I mean was the calculation is done on eth measures which are not visible in the example. (It became -- the same)

 

I think I still need more information to help. But if the problem is that you are doing an operation which has two levels of operations. Sum till one place and product post that values can help

 

Try

if(
HASONEFILTER(time_entries[Equipment Name (from Gsheet)]),
[Dias Operativos Measure] * [Arriendo diario],
sumx(values(time_entries[Equipment]),
[Dias Operativos Measure] * [Arriendo diario]))

sumx(values(time_entries[Equipment]),
[Dias Operativos Measure] * [Arriendo diario])


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

5 REPLIES 5
Highlighted
Super User IV
Super User IV

Re: Measure total incorrect

You seem to be using measures that are not visible in the same. I tried a simple formula and it worked. To help you further I need pbix file. If possible please share a sample pbix file after removing sensitive information.

 

ProductSum = sumx(time_entries,time_entries[NameDays]*time_entries[Daily])

Screenshot 2019-12-29 10.01.32.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Frequent Visitor

Re: Measure total incorrect

Thank you very much for your super-quick response @amitchandak !

I am not sure I understand what you mean by "using measures that are not visible in the same". 

 

I think your solution is working, because "Name Days" and "Daily" are columns. In my case they are measures whose home table is "time_entries". Sorry that I was not clear enough in the first place. 

"Days" is a measure that counts days of a filtered period (e.g. 01.01.2019 to 05.01.2019 = 4 days)

"Daily Rent" is a measure that uses a column value (=Monthly Rent) and divides it by the number of days the month in the filter has (in the example above: 31 days in January).

 

Unfortunately, I cannot share the PBI file as it is connected to a clients database. I hope you can still help me out.

Highlighted
Super User IV
Super User IV

Re: Measure total incorrect

What I mean was the calculation is done on eth measures which are not visible in the example. (It became -- the same)

 

I think I still need more information to help. But if the problem is that you are doing an operation which has two levels of operations. Sum till one place and product post that values can help

 

Try

if(
HASONEFILTER(time_entries[Equipment Name (from Gsheet)]),
[Dias Operativos Measure] * [Arriendo diario],
sumx(values(time_entries[Equipment]),
[Dias Operativos Measure] * [Arriendo diario]))

sumx(values(time_entries[Equipment]),
[Dias Operativos Measure] * [Arriendo diario])


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Community Support
Community Support

Re: Measure total incorrect

@SvenP 

 

You may check if [Equipment Name (from Gsheet)] is renamed to [Equipment Name] in the Visualizations pane and use ISINSCOPE instead if necessary.

https://community.powerbi.com/t5/Desktop/Sum-of-values-in-a-measure-with-divide-measure/m-p/296768#M...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Measure total incorrect

@amitchandak , fantastic! Adding the VALUES to the SUMX formula did the trick. I cannot really explain why at the moment, but it works which is what counts. I will chew on the why and how later. Thanks a lot for your help!

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors