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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
TaufikMaggangka
Helper II
Helper II

Create new table from two table and group by year

Hi Expert,

Need help to create new table(Not by data trasformation but by virtual table), to combine two table into one table. 
Here the illustrationL

Class Table

YearSchoolIdClassName
20211A
20211B
20211C
20211D
20211E
20211F
20212G
20212H
20212I
20212J
20212K
20212L
20221AA
20221AB
20221AC
20222BA
20222BB
20222BC

 

Date Table
Table that contain date from 2021 to 2022.

Basically I want to combine the two table and filtering by year, so the class in 2021 will only show in 2021, same with class in 2022 when we generating the new table.

Thank so much for help, stuck few days with this. quite new with power bi. If need more explanation let me know

2 ACCEPTED SOLUTIONS
Icey
Community Support
Community Support

Hi @TaufikMaggangka ,

 

Do you mean something like so?

Table =
FILTER ( CROSSJOIN ( Class, 'Date' ), Class[Year] = YEAR ( 'Date'[Date] ) )

Icey_0-1649664852569.png

 

 

Best Regards,

Icey

 

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

Hi @TaufikMaggangka ,

 

Try this:

Table =
FILTER (
    CROSSJOIN (
        SUMMARIZE ( Class, Class[SchoolId], Class[Classid], Class[Year] ),
        'Date'
    ),
    Class[Year] = YEAR ( 'Date'[Date] )
)

 

 

Best Regards,

Icey

 

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

5 REPLIES 5
Icey
Community Support
Community Support

Hi @TaufikMaggangka ,

 

Do you mean something like so?

Table =
FILTER ( CROSSJOIN ( Class, 'Date' ), Class[Year] = YEAR ( 'Date'[Date] ) )

Icey_0-1649664852569.png

 

 

Best Regards,

Icey

 

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

Hi @Icey , 
related to this approach, it is working fine. But I have an issue.
Is there a way to do it, If want to only retrive only specific column in both table. I try this way but it is merged all field on the both table. in my case My table more complicated, If I follow your way, it is increase the size of the power bi file, and the performance being slowly.

for example, Table Class.

School IDClassIDClassNameYear
11A2021
12B2021
13C2022
211AA2021
222BB2022
233CC2022
3111AAA2021
3222BBB2021


In this case, I only want to retrive SchoolId, and Classid and not including classname.

Really need your help,
I try to modified your dax, but cannot solve it.

Hi @TaufikMaggangka ,

 

Try this:

Table =
FILTER (
    CROSSJOIN (
        SUMMARIZE ( Class, Class[SchoolId], Class[Classid], Class[Year] ),
        'Date'
    ),
    Class[Year] = YEAR ( 'Date'[Date] )
)

 

 

Best Regards,

Icey

 

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

Thanks @IceyThank you so much. this is work.

daXtreme
Solution Sage
Solution Sage

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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