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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
angelc
New Member

calculate total outflow per month

CALCULATE(
SUM(Transactions[Amount]),
FILTER(
Transactions,
Transactions[Amount] < 0 &&
MONTH(Transactions[date]) = MONTH(Bank_Calendar[Date])
)
)

can anyone correct this for me?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @angelc ,

First of all, many thanks to @some_bih  for your very quick and effective replies, and I will give some additions below:

1.Create the sample table.

vjiewumsft_0-1710726267462.png

2.Create the calendar table.

vjiewumsft_1-1710726287274.png

3.Create the connection between two tables.

vjiewumsft_2-1710726297226.png

4.Create the measure to calculate the total.

 

Total Per Month = 
VAR sel_mon = SELECTEDVALUE(Bank_Calendar[Date])
RETURN
CALCULATE(
    SUM('Transactions'[Amount]),
    FILTER(
        'Transactions',
        'Transactions'[Amount] < 0 &&
        MONTH('Transactions'[Date]) = MONTH(sel_mon) &&
        YEAR('Transactions'[Date]) = YEAR(sel_mon)
    )
)

 

5.Drag the measure into the table visual. The result is shown below.

vjiewumsft_3-1710726352691.png

 

Best Regards,

Wisdom Wu

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

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @angelc ,

First of all, many thanks to @some_bih  for your very quick and effective replies, and I will give some additions below:

1.Create the sample table.

vjiewumsft_0-1710726267462.png

2.Create the calendar table.

vjiewumsft_1-1710726287274.png

3.Create the connection between two tables.

vjiewumsft_2-1710726297226.png

4.Create the measure to calculate the total.

 

Total Per Month = 
VAR sel_mon = SELECTEDVALUE(Bank_Calendar[Date])
RETURN
CALCULATE(
    SUM('Transactions'[Amount]),
    FILTER(
        'Transactions',
        'Transactions'[Amount] < 0 &&
        MONTH('Transactions'[Date]) = MONTH(sel_mon) &&
        YEAR('Transactions'[Date]) = YEAR(sel_mon)
    )
)

 

5.Drag the measure into the table visual. The result is shown below.

vjiewumsft_3-1710726352691.png

 

Best Regards,

Wisdom Wu

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

 

 

some_bih
Super User
Super User

Hi @angelc 

Order is important, if you do not have already it

1. Create Date / Calendar table - link

2. Create connection for Date and Fact table - link

3. v2 for measure 


CALCULATE(
SUM(Transactions[Amount]),
FILTER(
Transactions,
Transactions[Amount] < 0 &&

)
)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.