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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

The first day of the month a few month ago

I have  a table with 2 columns: Name, month

The column month contains month from the past 12 months.

I would like to create a new talbe that will take the existing, but will filter only the last 3 month not including the current.

So if today is 5/2023, I would like the new table to contain only the rows with months:

02/2023

03/2023

04/2023

05/2023

 

I am trying to create it the following way:

Existing table name: fullTable

 

New table = CALCULATETABLE (fullTable, FILTER(fullTable,  'fullTable'[month] > ??????)


1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your statement, I know you want to create a calculated table which will show 3 last months data to current dynamiclly.

New Table =
CALCULATETABLE (
    'Full Table',
    FILTER ( 'Full Table', 'Full Table'[Month] >= EOMONTH ( TODAY (), -4 ) + 1 )
)

Result is as below.

 vrzhoumsft_3-1683701190883.png

 

Best Regards,
Rico Zhou

 

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

6 REPLIES 6
FreemanZ
Super User
Super User

hi @Anonymous 

could you elaborate your case, with sufficient data and expected result directly?

Anonymous
Not applicable

In my model I have the following table:

Table: Full Table
|Name|Month|
|--| --- |
|a | 11/1/2022 |
|b |11/1/2022|
|c |11/1/2022 |
|c |1/1/2023 |
|b |2/1/2023|
|b |1/1/2023 |
|a |3/1/2023 |
|c |4/1/2023 |
|a |4/1/2023 |
|a |5/1/2023 |
|b |4/1/2023 |

 

 

I need to create from this table a filterred table which will look like this:

 


Table: New Table
|Name|Month|
|--| --- |
|b |2/1/2023|
|a |3/1/2023 |
|c |4/1/2023 |
|a |4/1/2023 |
|a |5/1/2023 |
|b |4/1/2023 |

Anonymous
Not applicable

Hi @Anonymous ,

 

According to your statement, I know you want to create a calculated table which will show 3 last months data to current dynamiclly.

New Table =
CALCULATETABLE (
    'Full Table',
    FILTER ( 'Full Table', 'Full Table'[Month] >= EOMONTH ( TODAY (), -4 ) + 1 )
)

Result is as below.

 vrzhoumsft_3-1683701190883.png

 

Best Regards,
Rico Zhou

 

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

 

 

hi @Anonymous 

try like:

New table =
CALCULATETABLE (
fullTable,
fullTable[month] >=DATE(2023,2,1)
)

Anonymous
Not applicable

Thanks, however, I need it to be dynamic. So if today we are in May, I need the  new table to be filterred from 2/23. In June it will need to be filterred from 3/23, in 5/24 fron 2/24 etc.

hi @Anonymous 

not sure if i fully get you, you may try to

1) plot a slicer with a new isolated table. You may create one like:

Slicer = ALL(fulltable[Month])

2) plot a table visual with necessary columns, but filtered with a measure like:

measure = 
IF(
    MAX(fulltable[Month])<SELECTEDVALUE(Slicer[Month])
        &&MAX(fulltable[Month])>=EDATE(SELECTEDVALUE(Slicer[Month]),-3),
    1,0
)

Note: choose 1 for the meaure.

 

it worked like:

FreemanZ_0-1683455985906.pngFreemanZ_1-1683456001801.png

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors