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 a measure within a dax statement where the measure ignores current filters

I'm trying to figure out how to do this. I feel like it should be simple and straight forward but having troubles locating the syntax to complete it.  I have a need to make use of an existing measure, but within the Dax statement i need to use the measure without filters.


Is there something equivilent to (as the below isn't actually correct):

= All([MeasureName])

Essentially i need "This measure, but without filters" that i can use within a dax statement

6 REPLIES 6
Phil_Seamark
Employee
Employee

Hi @Anonymous

 

Do you have the code for the existing measure you are trying to do this to?

 

eg, if your existing measure is something like

 

existing measure = SUM(Table[Column])

then you can just copy the expression used and wrap a CALCULATE and filter around it

 

like this

 

new measure = CALCULATE( SUM(Table[Column]) , ALL(Table))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

Thanks for the reply @Phil_Seamark.  Essentially thats down the line of the solution i've come up with so far.  I was wondering if there was a much more simplier, cleaner solution.

In my case it isn't just a simple measure.  I'm writing a [Revenue per FTE] measure and need a [SumMax Revenue Per FTE]
In this instance i'm lucky as the calculation is simply: Divide([Revenue], [FTE])

So i've had to take all of the dax code that makes up [Revenue] and [FTE] and placed that into [SumMax Revenue Per FTE]

I just know there will be an occasion down the track whereby i'll have created some very complex Measure and i'll need to perform an operation on it that won't be so clean to write into a single dax statement.

Hi @Anonymous,

 

Did you try to directly use measure in calculate?  (E.g. Calculate([Measure], All(Table)))


In addition, some functions which contain the filter can effect on measure, you can use all function in these filter to ignore the current filter.(for example: SUMX, AVERAGEX,COUNTX...)

 

BTW, I'd like to suggest you use the way which Phil_Seamark metioned, if you use filter in combination, the measure may get the wrong result.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi @v-shex-msft,  Calculate can't use a measure for the expression parameter.

Hi @Anonymous,

 

Perhaps you can take a look at below article:

Optimizing DAX expressions involving multiple measures

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

What a great looking article!  I'll have a read now.

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.