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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.