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
A3DS
New Member

Resume table by year and month

Hi all,

 

I'm trying to build a table inside powerbi that will be aggregating information from 2 other tables based on year and month.
I know I'm doing something wrong but I'm kinda new to powerbi.

The date column was build to have only "year and month" since I want to build a resume of everything done for that month.

My design can be wrong and any sugestions are apreciated.

The formula I was working on the month total is giving me a hard time and solving it will probably help for the next ones.

MonthTotal =
if(COUNTROWS(Table1)>0,
CALCULATE(SUM(Table1[Amount]),DATESBETWEEN(Table1[Posting Date],STARTOFMONTH(ThisTable[Date]),ENDOFMONTH(ThisTable[Date])))
)
In this pic below I have a resume of what I'm trying to achieve to make it easier to understand.

A3DS_1-1655107746482.png

 

Any kind of help would be apreciated.

 

 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @A3DS ,

 

Please create these calculated columns.

 

Year = YEAR('Table'[Date])
Total = 
VAR _year =
    YEAR ( 'Table'[Date] )
VAR _date = 'Table'[Date]
VAR _total =
    CALCULATE (
        SUM ( 'Table'[MonthTotal] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Date] <= _date && _year = 'Table'[Year] )
    )
RETURN
    _total

vcgaomsft_0-1655374995536.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

1 REPLY 1
v-cgao-msft
Community Support
Community Support

Hi @A3DS ,

 

Please create these calculated columns.

 

Year = YEAR('Table'[Date])
Total = 
VAR _year =
    YEAR ( 'Table'[Date] )
VAR _date = 'Table'[Date]
VAR _total =
    CALCULATE (
        SUM ( 'Table'[MonthTotal] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Date] <= _date && _year = 'Table'[Year] )
    )
RETURN
    _total

vcgaomsft_0-1655374995536.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

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.