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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Subract within a column applying multiple filters

Hi, I have a dataset that takes a daily snapshot of clients with measures; client count, weeks and hours. For any two given dates I want to be able to calculate the variance (most recent minus oldest) in the measures, i.e. change in count, hours and weeks. I want to be able to filter on client name, manager and segment. Have tried indexing and using EARLIER. Guidance would be greatly appreciated.

 

Picture1.png

 

The variance between 4th and 5th would show Change in Clients 1, Change in Hours 150 and Change in Weeks 2.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous 

Assuming you are using a date table selected two dates in slicer then you can have like

Measure =
var _min = minx('Date','Date'[Date])
var _max = maxx('Date','Date'[Date])
return
calculate(sum(Table[Hours]),filter('Date','Date'[Date]=_min))- calculate(Table[Value],filter('Date','Date'[Date]=_max))

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

One way would be to use Data>Filter>Autofilter
Use the dropdown on the second column to select "blanks" and that will give
you the list of stores you are stillwaiting to hear from.

Anonymous
Not applicable

I'm sorry, it's dumb question time, I'm fairly new to Power BI, where do I find the options Data, Filter, Autofilter? Thanks for advice.

amitchandak
Super User
Super User

@Anonymous 

Assuming you are using a date table selected two dates in slicer then you can have like

Measure =
var _min = minx('Date','Date'[Date])
var _max = maxx('Date','Date'[Date])
return
calculate(sum(Table[Hours]),filter('Date','Date'[Date]=_min))- calculate(Table[Value],filter('Date','Date'[Date]=_max))

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
Anonymous
Not applicable

Hi, it worked and I'm putting it into production. How can I develop this further to highlight additonal clients (for example) that are added to the table? Whilst totals work the details seem to fll over if new entrants did not xist in the table previously?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.