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
RMDNA
Solution Sage
Solution Sage

Filter-agnostic variable

I have a variable, Win Revenue, that is affected by Fiscal Year, due to table schema. I need Win Revenue to just ignore when Fiscal Year changes. Is there any way to do that with custom columns/etc.?

 

If so, I now need a different variable to change based on the value of fiscal year, and have that apply as a filter to Win Revenue.

 

e.g. if I change Fiscal Year to FY17, I don't want that to directly affect Win Revenue (although it normally would), but I do need to filter Win Revenue by different critera now that FY has changed.

 

I'll help with clarification where I can. I'm having a lot of issues trying to explain this.

3 REPLIES 3
MFelix
Super User
Super User

Hi @RMDNA,

 

From what I can uderstand from your text you need a variable that overlooks the Fiscal Year to do this in your measure you need to use the ALL function that allows you to "overlook" the filter that you may have in your table /visual and consider the full table/column to make the calculation.

 

To have a different variable affecting your measure you need to apply a FILTER on your measure, both of this need to be applied by CALCULATED  formula, but without further information it's hard to give you a more complete answer.

 

Please check this link and also this where you have several examples of the usage of filtering in the measure.

 

This sites are from @marcorusso and @AlbertoFerrari that make very compreensive articles on DAX.

 

As I said if you provide any addtional information or data samples I can help you better.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix,

 

I'm familiar with FILTER and CALCULATE, but not ALL/ALLEXCEPT.

 

So Revenue Won is:

 

Total Revenue Won = 
CALCULATE(
	SUM('Table 1'[Total Revenue]),
	       TREATAS({("Won")}, 'Table 1'[Status]
                )
         )

Fiscal Year is a field in a different table. From looking at the examples, I'm having trouble figuring out where to insert our ALL/ALLEXCEPT. Any help?

 

 

Once this works, I'll probably be able to get the second part on my own.

@RMDNA,

You can create the measure using FILTER function or INSPECT function instead, then add the ALL/ALLEXCEPT function into your DAX formula, for more details, please review this blog: http://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/ .

If you have any questions about the DAX, please share sample data of your tables and post expected result here.

Regards,
Lydia

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

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.