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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Using ALL() but Measure is still being filtered by Slicer/Column

I have this measure built out to calculate an account's exposure in the prior quarter:

 
Prior Qtr Exposure =
var currentqtr = MAX(Account_Data_Total[Quarter])
var priorqtr = CALCULATE(MAX(Account_Data_Total[Quarter]),Account_Data_Total[Quarter]<>currentqtr)
return
CALCULATE(SUMX(Account_Data_Total,Account_Data_Total[Exposure]),Account_Data_Total[Quarter]=priorqtr)
 
The measure works, except when I add the column "Exposure Bucket" to the table, and then the prior quarter exposure doesn't calculate for the accounts in which the exposure changed from one exposure bucket in one quarter to another bucket in the next quarter.
 
I tried using ALL(Exposure Bucket), but it didn't solve anything.  
1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

You will need to add ALL() function when calculating priorqtr.
And if you want previous quarter, you might consider to use "<" instead of "<>".

 

Measure =
var currentqtr = MAX(Account_Data_Total[Quarter])
var priorqtr = CALCULATE(MAX(Account_Data_Total[Quarter]),FILTER(ALL(Account_Data_Total),Account_Data_Total[Quarter]<currentqtr))
return
priorqtr

 

Capture.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you so much for the advice, this worked very well!

 

v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

You will need to add ALL() function when calculating priorqtr.
And if you want previous quarter, you might consider to use "<" instead of "<>".

 

Measure =
var currentqtr = MAX(Account_Data_Total[Quarter])
var priorqtr = CALCULATE(MAX(Account_Data_Total[Quarter]),FILTER(ALL(Account_Data_Total),Account_Data_Total[Quarter]<currentqtr))
return
priorqtr

 

Capture.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@Anonymous , Not very clear. First of use time intelligence for this

 

example

 

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

 

 

Also for what you have in this period , what you had in last period

follow the same approach using QTD and account and bucket

 

Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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