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
andybamber
Helper III
Helper III

DAX Measure - Keepfilters

Hello!

 

I have a report for company headcount. The organisation has 5 levels going from Domain at the top to cost centre at level 5. The report has an organisational slicer which thge user can then use to see the headcount at any of these levels.

 

We now have headcount budgets, but these are only set at the Domain level. I have a KPI visual and what I need to do is restrict Indicator (current headcount) to allways only show the Domain level headcount even if the user selects a level below. I wrote this measure thinking keepfilters would ensure this.

 

 Headcount_KPI = CALCULATE(DISTINCTCOUNT(SNAP_DWH_RES_RESOURCE[resource_key]),LASTDATE(SNAP_DWH_RES_RESOURCE[snaphot_stamp]),
KEEPFILTERS(DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "A" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "B" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "C" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "D" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "E" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "F" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "G" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "H" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "I" ||
DWH_ODF_Z_CC_OWNERS_LN[cc_domain] = "J"
))

 

But when a user selects a lower level this seems to be ignored at the headcount for the new level is displayed... Can anyone advise where I am going wrong?

 

Thanks

Andy

1 ACCEPTED SOLUTION
AnkitKukreja
Super User
Super User

Hi @andybamber 

 

Use remove filters instead, what all does is ignore filters from that table and you can choose particular column instead of table as well. 

 

Please refer to below link.

https://www.youtube.com/watch?v=9qKe66uBce8

 

Thanks,

Ankit

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

View solution in original post

2 REPLIES 2
AnkitKukreja
Super User
Super User

Hi @andybamber 

 

Use remove filters instead, what all does is ignore filters from that table and you can choose particular column instead of table as well. 

 

Please refer to below link.

https://www.youtube.com/watch?v=9qKe66uBce8

 

Thanks,

Ankit

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

perfect, thanks Ankit!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.