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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Filter All not working ?

Hi All, 

I'm trying to get YTD counts and using the logic below , however the same count is shown despite having different report filters . Any idea what Im missing ?

 

YTD Milestone Count = VAR startdate = DATE(YEAR(TODAY()),1,1)
var enddate = TODAY()
RETURN
CALCULATE(
COUNTROWS(fact_milestones),
FILTER(ALL(fact_milestones[milestone_date],fact_milestones[summary_milestone_type],fact_milestones[milestone_type],fact_milestones[RSfam_milestonetype]),fact_milestones[milestone_date]>= startdate
&& fact_milestones[milestone_date]<= enddate))+0
Below are the report filters that should show the counts based on the filters .TIA
Screenshot 2022-01-04 101755.png
1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

The biggest difference between ALL and ALLSELECTED is that the ALL function ignores all filters, regardless of where they are coming from. In contrast, the ALLSELECTED function only ignores filters that are coming from the inner query.

 

I have created a data sample :

Eyelyn9_0-1641524174140.png

 

Please try ALLSELECTED()

YTD Milestone Count = 
VAR startdate = DATE(YEAR(TODAY()),1,1)
var enddate = TODAY()
RETURN
CALCULATE(
COUNTROWS(fact_milestones),
FILTER(ALLSELECTED(fact_milestones),[milestone_date]>= startdate&& [milestone_date]<= enddate))+0

 Output:

Eyelyn9_2-1641524629914.png

 

Here are some blogs talking about the differences , please kindly refer to:

What's the Main Difference Between ALL &amp; ALLSELECT... - Microsoft Power BI Community

The Difference Between ALL And ALLSELECTED DAX Functions In Power BI | Enterprise DNA

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

The biggest difference between ALL and ALLSELECTED is that the ALL function ignores all filters, regardless of where they are coming from. In contrast, the ALLSELECTED function only ignores filters that are coming from the inner query.

 

I have created a data sample :

Eyelyn9_0-1641524174140.png

 

Please try ALLSELECTED()

YTD Milestone Count = 
VAR startdate = DATE(YEAR(TODAY()),1,1)
var enddate = TODAY()
RETURN
CALCULATE(
COUNTROWS(fact_milestones),
FILTER(ALLSELECTED(fact_milestones),[milestone_date]>= startdate&& [milestone_date]<= enddate))+0

 Output:

Eyelyn9_2-1641524629914.png

 

Here are some blogs talking about the differences , please kindly refer to:

What's the Main Difference Between ALL &amp; ALLSELECT... - Microsoft Power BI Community

The Difference Between ALL And ALLSELECTED DAX Functions In Power BI | Enterprise DNA

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

parry2k
Super User
Super User

@Anonymous because you are using ALL  in your measure, it is removing filters on all those columns.

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors