cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Substitutes for EARLIER?

Hi,

 

My question comes down to "the best practices". I've had this problem quite a few times and I don't know how to approach it in the right way. So, let's say that I have some table with sales amount and customer id. What I would do to get aggregated value for each customer would be:

CALCULATE(SUM(table[sales_amount]);FILTER(table;table[customer_id]=EARLIER(table[customer_id]))

However, working with VS studio tabular model designer, this usually results in freezing editor and urgent need to use crtl + alt + delete.  

 

I just wonder if there is some more memory-efficient solution or is it my tabular model design that is bad. I would be very grateful if someone could point me to the right direction. 

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: Substitutes for EARLIER?

@ThomasCz , You can create a measure

CALCULATE(SUM(table[sales_amount]);allexcept(table[customer_id]))

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Super User VII
Super User VII

Re: Substitutes for EARLIER?

@ThomasCz I don't know why would you use anything in the filter, the simple sum should work, just drop customer and sum(amount) measure on the visual and it would work, until I'm missing anything.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!






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
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors