cancel
Showing results for
Did you mean:
Helper I

## 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
Community Support

Hi @iab_pbi ,

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

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.
3 REPLIES 3
Helper I

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

Community Support

Hi @iab_pbi ,

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

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.
Super User

@iab_pbi , 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/b...

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.

Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

Announcements

#### Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

#### Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

#### What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

#### Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors