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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Lund
Frequent Visitor

Dynamic table SUM next 6 months

Hi

I have my table like example:

 

DateQty
2022-11-0122
2022-12-1536
2023-01-241
2023-03-154
[...][...]
2024-01-214
2024-01-235

 

What i need, is a dynamic visual table with sum values next 6 months and a column with all values before actual month and a colm with valuea after 6 months like this:

All Before actual monthDec 22Jan 23Feb 23Mar 23Apr 23May 23All from june 23 and after
2236103009

 

And next month it should be

All Before actual monthJan 23Feb 23Mar 23Apr 23May 23Jun 23All from july 23 and after
581030009

 

How can i solve that?

4 REPLIES 4
Lund
Frequent Visitor

Sorry, I can't format the tables better in my question post 😞

amitchandak
Super User
Super User

@Lund , New column in the date table and measure you need

 


New column = if(eomonth([Date], 0) < eomonth(Today(),0) , "All Month Before actual", format([Date], "mmm-yyyy"))

 

 

 

measure = calculate(sum(Table[Value]), filter(Table, Table[Date] <= eomonth(today(),6)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Yeah, not a bad soluiton. That works. 😼
But i also need a sum of all after next 6 month.

And the sorting of my column are alphabetich and not by date

 

My result:

bi 10.png

Anonymous
Not applicable

Hi @Lund ,

You can create a measure as below to get the next 6 months values:

Measure =
CALCULATE (
    SUM ( 'table'[value] ),
    FILTER (
        ALLSELECTED ( 'table' ),
        'table'[date] >= TODAY ()
            && 'table'[date] <= EOMONTH ( TODAY (), 6 )
            && 'table'[date] <= SELECTEDVALUE ( 'date'[date] )
    )
)

And which field you are using on the matrix Columns field option? What's the data ype of that field? Is it a Text type? You can refer the following blog to custom sort the field values...

Sort a Column with a Custom Order in Power BI

yingyinr_0-1670233556822.png

 

If the above one can't help you get the desired result, please provide some sample data in your table 'employ' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.