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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Lidou_Cand
Helper III
Helper III

ALLSELECTED AND POWER BI FILTER

Hello, I need your help.

I am working on a PowerBI report which is connected to a "live connection" tabular model for which I am using a "Weight_PTF" measure.

This metric uses the ALLSELECTED function to calculate a ratio.

 

 

VAR CurrentAssetVal = [SEC_MarketValue_PTF]

VAR ParentAssetVal = CALCULATE ([SEC_MarketValue_PTF], ALLSELECTED ())

VAR RatioToParent = DIVIDE (CurrentAssetVal, ParentAssetVal)

RETURN RatioToParent

 

 

This metric works well when we use Excel and users are happy.

The problem comes when I use the indicator in PowerBI.

The trouble is that in my PBI report we have filters and we don't want those filters to affect our metric.

For example, on the visual we want to display a top N but without recalculating the ratio.

Do you have any idea how to bypass filters in Power BI reports?

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @Lidou_Cand ,

 

Using ALLSELECTED() function will calculate the filtered table. You may use ALL() function instead.

It's better to share some sample data and expected result if you need help with DAX formula.

 

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

Hi @Lidou_Cand ,

 

This depends on the calculation you are doing and the type of filters you apply, in this case you will need to apply an ALL statement to your calculation that way when you do a TOPN the value will not be recalculated.

 

When using the ALLSELECTED the filter is applied to the selected values this means that if you have a list of 50 customers they are all included in the calculation when you apply a TOP 5 when using the all selected the calculation will only consider the 5 customers and not the 50. Using ALL you will overpass the filter context and return the full column(s).

 

Be aware that depending on the measure and the context you may need to use a temporary table or similar.


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



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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