Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I saw this code snippet in a wokrshop held by Jeffrey Wang. The snippet defines a measure to calculate the number of returning customers by date, in a very standard data model with sales, products and customers.
-----------------------
Solved! Go to Solution.
Good spot! This ALL(...) is not necessary. It serves no purpose, even though it's not harmful, either. The FILTER overwrites any filter present on the column anyway, so removing any filters via ALL is redundant.
Good spot! This ALL(...) is not necessary. It serves no purpose, even though it's not harmful, either. The FILTER overwrites any filter present on the column anyway, so removing any filters via ALL is redundant.
Hey daxer, thanks for the explanation!
Hi @amitchandak , thanks a lot for taking the time to answer, but I am not sure it responds to the question i had. In any case, it is much appreciated.
@Anonymous , I usually follow a measure approch
Current = sum(Table[Sales])
past =
Var _min = minx(allselected('Date'), Date[Date])
return
calculate(sum(Table[Sales]), filter(all('Date'), Date[Date] <_min)
new = countx(values(customer[Customer]), if(not(isblank([Current])) && isblank([Past]) , [Customer], bank()))
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
6 | |
5 |
User | Count |
---|---|
17 | |
14 | |
10 | |
9 | |
6 |