Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Table is not calculating totals correctly

Hi everyone,

 

I have a minor problem with my measures. I am currently using two measures that are just simple sums from a table. These are then subtracted which will either give me a positive or negative number. I want to sum all the positive numbers, which I have done, but currently, the total is not working properly, as seen below. 

 

Unanswered Requests= IF(([Allocated Hours]-[Requested Hours])<=0, [Requested Hours]-[Allocated Hours],0)

 

Capture.PNG

 

As you can see the total is 0 when it should be 358. 

7 REPLIES 7
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Do you mind sharing your .pbix file?
I need to check your data model and the formula of [Requested Hours] and [Allocated Hours].

Or refer to the link .

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Anonymous
Not applicable

Hi Lionel, 

Can't share the file, but the two measures are just sums of two different columns in the same table. 

Hi @Anonymous ,

 

This problem is very common, but I can not analyze the problem without sample data and formulas. Try to refer to the similar case.

Total is wrong 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tahreem24
Super User
Super User

@Anonymous ,

I tried to replica your scenario at my end. I have created Measure for Unanswered Requested and getting correct result as per input.

Capture.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Thanks for the reply!

Using your calculation I actually get a total, but it seems to ignore filters and just sum everything? Capture.PNG

amitchandak
Super User
Super User

@Anonymous ,

You have try like

Unanswered Requests= sumx(values(Table[?] ),IF(([Allocated Hours]-[Requested Hours])<=0, [Requested Hours]-[Allocated Hours],0))

 

where "?" is the column you are grouping on.

example

Unanswered Requests= sumx(values(Table[user]),IF(([Allocated Hours]-[Requested Hours])<=0, [Requested Hours]-[Allocated Hours],0))

 

Anonymous
Not applicable

Hi,
Thanks for commenting

The problem is that the I cant just sum 1 column as I want the difference between two columns

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.