Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I am getting in the topic of filter context and I would like to create an easy formula in my report that filters based on values in another table.Somehow however it doesn't work and therefore I created an example sample with 2 Tables.
I would need to sum up the 'hours' in table 1 based on the department filter. Hence, result would need to be 4
Could you please support? That would be much appreciated!
Regards
Hi, @YBZ ;
Hi, @YBZ ;
Try it,
SumHours =
CALCULATE (
SUM ( Table1[hours] ),
FILTER (
Table1,
Table1[department] IN ALLSELECTED ( TableSelectedDepartment[department] )
)
)
Or
SumHours =
CALCULATE (
SUM ( Table1[hours] ),
FILTER (
Table1,
Table1[department] = MAX ( TableSelectedDepartment[department] )))
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.
Hi @YBZ
First of all, you can create a realtionship between the tables - with direction from TableSelectedDepartment to 1, So basically TableSelectedDepartment acts like a dimension.
If that somhow not possible you can create the following measure:
SumHours=
Calaculate(Sum(Table1[hours])
,FILTER(Table1
,Table1[department]=TableSelectedDepartment[department]))
Hope it helps,
David Ganor
Thanks, I would indeed a measure as I made the connection in my database too difficult... 🙂
I understand the logic behind it, but when I try it in PowerBI, it seems that PowerBI only allows me to put a measure for TableSelectedDepartment[department]).
SumHours=
Calaculate(Sum(Table1[hours])
,FILTER(Table1
,Table1[department]=TableSelectedDepartment[department]))
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.