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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Calculate+filter+max error

I am just using below formula to calculate Rev/Sqft by  Catogory  by DataMth (data month)

00This_month_R.S = CALCULATE( ('Table'[00Rev]/'Table'[Sqft]),filter(ALLSELECTED('Table'),'Table'[DataMth]<=max('Table'[DataMth])))
I found that when I choose one catogory, then answer is correct, totally the same with excel answer.
 DataMth   
Catogory201911201912202001202002
A705.2295705.2643528.5895448.5803

But when I choose all catogory, found that all column data are the same, did not filter  by catogory, is anything missed in my formula ?  thanks a lot.

 

 DataMth   
Catogory201911201912202001202002
A393.8481424.5263373.781337.5545
E393.8481424.5263373.781337.5545
G393.8481424.5263373.781337.5545
H393.8481424.5263373.781337.5545


 

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@Anonymous 

00This_month_R.S = CALCULATE( ('Table'[00Rev]/'Table'[Sqft]), filter(ALLEXCEPT('Table', 'Table'[Catogory]), 'Table'[DataMth]<=max('Table'[DataMth])))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous 

Move month into a separate table

Try

This_month_R.S = CALCULATE( divide('Table'[00Rev],'Table'[Sqft]),filter(ALLSELECTED('Month'),'Table'[DataMth]<=max('Month'[DataMth])))

Or
This_month_R.S = CALCULATE( divide(sum('Table'[00Rev]),sum('Table'[Sqft])),filter(ALLSELECTED('Month'),'Table'[DataMth]<=max('Month'[DataMth])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Thank you, I tried, but seems result is not correct, smaller more than it should be.

az38
Community Champion
Community Champion

@Anonymous 

00This_month_R.S = CALCULATE( ('Table'[00Rev]/'Table'[Sqft]), filter(ALLEXCEPT('Table', 'Table'[Catogory]), 'Table'[DataMth]<=max('Table'[DataMth])))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Thank you, it does work!

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.