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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Dario729
Frequent Visitor

Create a new table with colmuns filtered by dates

Hellow everyone. I am working on a new table that is built from a database that includes this columns:

Clients, Accounts, Dates (from month 1 to month12) and Values

 

And I need to organice in a separate table per Clients and Accounts the values from moth 1, next the values from moth 2 andso on.

I tried with the next code but I find ount that the GENERATE function do not allow dates in the filters and I also cannot add the Accounts column next to the Clients column.

 
Table_1 =
GENERATE (
    VALUES ( Table[Clients] ),
VALUES ( Table[Accounts] ),
    VAR Month1 =
        CALCULATE ( SUM ( Table[Value] ), Table[Month] = "31-01-2022" )
    VAR Month2 =
        CALCULATE ( SUM ( Table[Value] ), Table[Month] = "28-02-2022")
.....
        RETURN
        ROW (
            "Month_1", Month1, "Month_2", Month2
            )
)
 
Thanks in advance!!!
1 ACCEPTED SOLUTION

Hi @Dario729 

 

This is my test table:

vyadongfmsft_7-1667812686195.png

 

Please transform data in Power Query: Select Date and Value column - Pivot column.

vyadongfmsft_8-1667812751450.png

 

Select OK:

vyadongfmsft_9-1667812769670.png

 

You will get a table like this, I think this is the expected table you want:

vyadongfmsft_6-1667812638733.png

 

Best regards,

Yadong Fang

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

3 REPLIES 3
amitchandak
Super User
Super User

@Dario729 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Check if this can help

https://amitchandak.medium.com/power-bi-power-query-vs-dax-months-between-range-df019cec823b



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

Sure! In the next picture I try to show the initial and desired table:

 

Sin título.png

Hi @Dario729 

 

This is my test table:

vyadongfmsft_7-1667812686195.png

 

Please transform data in Power Query: Select Date and Value column - Pivot column.

vyadongfmsft_8-1667812751450.png

 

Select OK:

vyadongfmsft_9-1667812769670.png

 

You will get a table like this, I think this is the expected table you want:

vyadongfmsft_6-1667812638733.png

 

Best regards,

Yadong Fang

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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