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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lancepr
New Member

Math on a table formula

I have a table that keeps track of items that come in out with a bit field, so I do not have negative number

ID  Product InOut qty Date

1  Widget2 True  3     8/1/17

2  Widget2 False 2   8/2/17

3  Widget3 True  10     8/1/17

4  Widget3 False 8   8/2/17

 

 

The total of widget2 = 1

total of widget3 = 2

 

I am having trouble calculating this in PowerBI

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lancepr 

I have created a new column named New Qty:

New Qty = IF(T7[InOut] = TRUE(),T7[Qty], -T7[Qty])

Then another column to SUM:

Totals =
CALCULATE (
    SUM ( T7[New Qty] ),
    FILTER ( T7, T7[Prod] = EARLIER ( T7[Prod] ) )
)

2019-06-18 11_08_56-Window.png

 

Good Luck!

A

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @lancepr 

I have created a new column named New Qty:

New Qty = IF(T7[InOut] = TRUE(),T7[Qty], -T7[Qty])

Then another column to SUM:

Totals =
CALCULATE (
    SUM ( T7[New Qty] ),
    FILTER ( T7, T7[Prod] = EARLIER ( T7[Prod] ) )
)

2019-06-18 11_08_56-Window.png

 

Good Luck!

A

that worked, thanks!

adityavighne
Continued Contributor
Continued Contributor

@lancepr 

 

In the table view, select Product and select 'don't summerise option' then select again product and take count of this.

 

I hope this will resolve your issue.

 

If not post the correct table screenshot for better understanding.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.