The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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 ?
Solved! Go to Solution.
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 :
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:
Here are some blogs talking about the differences , please kindly refer to:
What's the Main Difference Between ALL & 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.
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 :
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:
Here are some blogs talking about the differences , please kindly refer to:
What's the Main Difference Between ALL & 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.
@Anonymous because you are using ALL in your measure, it is removing filters on all those columns.
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
142 | |
109 | |
107 | |
76 | |
61 |
User | Count |
---|---|
276 | |
129 | |
124 | |
100 | |
89 |