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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
KhaledEid
Frequent Visitor

Creating table from two tables using SUMMARIZE

I am trying to create a table with three columns (Full Name, Actual Hours, Contracted Hours)

 

I created the below measure

Top Staff =
VAR K=
FILTER(HR_MonthlySalary, HR_MonthlySalary[Actual Hours] > HR_MonthlySalary[Hours Contracted])
Return
CALCULATETABLE(
SUMMARIZE(HR_Data_Final,HR_Data_Final[FullName]),
KEEPFILTERS(K)
)
but got the below error
KhaledEid_0-1641378177498.png

 

Am I missing something?

 

 

 

 

 

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

Hi, @KhaledEid ;

According to the official document,  KEEPFILTERS(<expression>) Any expression.

 however in your dax,  "K" is return a table ,not a expression . 

vyalanwumsft_0-1641802894789.png

so i think you could modify it.

Top Staff =
CALCULATETABLE (
    SUMMARIZE ( HR_Data_Final, HR_Data_Final[FullName] ),
    KEEPFILTERS ( HR_MonthlySalary[Actual Hours] > HR_MonthlySalary[Hours Contracted] )
)

 

Best Regards,
Community Support Team_ Yalan Wu
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
v-yalanwu-msft
Community Support
Community Support

Hi, @KhaledEid ;

According to the official document,  KEEPFILTERS(<expression>) Any expression.

 however in your dax,  "K" is return a table ,not a expression . 

vyalanwumsft_0-1641802894789.png

so i think you could modify it.

Top Staff =
CALCULATETABLE (
    SUMMARIZE ( HR_Data_Final, HR_Data_Final[FullName] ),
    KEEPFILTERS ( HR_MonthlySalary[Actual Hours] > HR_MonthlySalary[Hours Contracted] )
)

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@KhaledEid , this code will return table, Seem like you are using it in a measure

 

table ->  Top Staff =
VAR K=
FILTER(HR_MonthlySalary, HR_MonthlySalary[Actual Hours] > HR_MonthlySalary[Hours Contracted])
Return
CALCULATETABLE(
SUMMARIZE(HR_Data_Final,HR_Data_Final[FullName]),
K
)

 

 

Measure  ->

Top Staff =
VAR K=
FILTER(HR_MonthlySalary, HR_MonthlySalary[Actual Hours] > HR_MonthlySalary[Hours Contracted])
Return
countrows( CALCULATETABLE(
SUMMARIZE(HR_Data_Final,HR_Data_Final[FullName]),
K
))

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

thanks for your answer,
but the table code returned the same error.  i need to create a table not measure

 

Helpful resources

Announcements
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.