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

ALL does not ignore the slicer in DAX

Hello,

I am struggling with the ALL and FILTER here. I have a report conneting live to Tabular model. 

 

Data model is like this - 

 

CarModel                            Details                                                        Date                    Country

ModelName  --------->  ModelName, CarID, Delivery Year                  Year                    CountryCode

                                        ,RetailCountryCD

 

I want to count the ratio of  "total selected model cars"  to the "toal cars" of that year and country. 

Relationship :  "CarModel" and "Details" tables are connected on "ModelName".  I have a slicer with "ModelName" from" CarModel " table. Another slicer is with "CountryCode"

 

I have a matrix where Year is used as column and shows the ratio.

 

Var selectedyear = SELECTEDVALUE('Calendar'[Year]; 0 )
var selectedcountry = SELECTEDVALUE(Country[CountryCode])
 
this seems not working as ALL does not ignore the ModelName slicer.
 
var cp = CALCULATE( COUNT(Details[CarID]); Details[Delivery Year]= selectedyear ; Details[RetailCountryCD]= selectedcountry)
 
var cptotal = CALCULATE( COUNT(Details[CarID]); Details[Delivery Year]= selectedyear ; Details[RetailCountryCD]= selectedcountry; ALL(Details[ModelName]))
 
Please help how to ignore the slicer in this formula as seems ALL has no impact it still has ModelName filter applies as cp/cptotal is calculated to 1.
 
I observed that in this formula ALL works - var cptotal = CALCULATE( COUNT(Details[CarID]); ALL(Details[ModelName]))

but not in above with Year and Country filters.

 

 

Regards

Madan

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Try changing the reference in your measure from ALL(Details[ModelName])) to ALL(CarModel[ModelName]) -assuming that you are using the CarModel[ModelName] as your slicer.

var cptotal = CALCULATE( COUNT(Details[CarID]);
                       Details[Delivery Year]= selectedyear ;
                       Details[RetailCountryCD]= selectedcountry;
                            ALL(CarModel[ModelName]))

 

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Can you share sample data and what you want to expect? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Try changing the reference in your measure from ALL(Details[ModelName])) to ALL(CarModel[ModelName]) -assuming that you are using the CarModel[ModelName] as your slicer.

var cptotal = CALCULATE( COUNT(Details[CarID]);
                       Details[Delivery Year]= selectedyear ;
                       Details[RetailCountryCD]= selectedcountry;
                            ALL(CarModel[ModelName]))

 

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

I have redeployed and refreshed the model and this has started working. Thanks @PaulDBrown 

Anonymous
Not applicable

Thanks. But seems this has no impact. Result is same.

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.