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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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])))

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors