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.
Hello,
I have problem while calculating the sum of the rows in a matrix, while playing with the date. To be precise, I have one table which has orders for all customers at the specific time, the table looks like this:
Customer | Order date | Product | Price |
Cust A | 11.01.2021 | X | 10 |
Cust B | 10.01.2021 | Y | 2 |
Cust A | 13.05.2021 | Z | 5 |
I have a specific filter that filters only the order date. The solution of my problem would be a following matrix:
Customer | Total Revenue |
Customer A | 15 |
Customer B | 2 |
I have tried using the following DAX, but every time, the total revenue changes after I play with the filter.
REVENUE = CALCULATE(
SUM(ORDERS[PRICE]),
ALL(ORDERS[DATE])
)
I have also tried with this DAX expression, but then I got the total sum in every row, which is still not the right thing, as showed below:
REVENUE = CALCULATE(
SUM(ORDERS[PRICE]),
ALL(ORDERS)
)
Customer | Total Revenue |
Customer A | 17 |
Customer B | 17 |
Is there a possible way to calculate the total sum of each customer without being influenced of the date value?
Thank you very much.
Solved! Go to Solution.
I have solved my problem, the right DAX expression was
REVENUE = CALCULATE(
SUM(ORDERS[PRICE]),
ALL(ORDERS)
)
The problem was, that I had a filter on the price of the page and it was messing my measure. But after I removed it, everything worked like a charm.
I have solved my problem, the right DAX expression was
REVENUE = CALCULATE(
SUM(ORDERS[PRICE]),
ALL(ORDERS)
)
The problem was, that I had a filter on the price of the page and it was messing my measure. But after I removed it, everything worked like a charm.
Hello @amitchandak ,
I don't know why, but when I use the first DAX, then the calculation is influenced by the filter (which should not be the case) and when I use the second DAX I don't get the right values in the grand total.
Thank you for the fast response 🙂
@stefani_vileva , this one ?
CALCULATE(
SUM(ORDERS[PRICE]),
filter(all(Order), Order[Customer] = max(Order[Customer] )
)
)
Then try
sumx(values(Order[Customer] ) ,
CALCULATE(
SUM(ORDERS[PRICE]),
filter(all(Order), Order[Customer] = max(Order[Customer] )
)
) )
If I use the SUMX, doesn't mean that the revenue would be doubled when summarized?
@stefani_vileva , what you want in table 2 is
SUM(ORDERS[PRICE])
if you want to ignore date filter
CALCULATE(
SUM(ORDERS[PRICE]),
removefilters(ORDERS[DATE])
)
or
CALCULATE(
SUM(ORDERS[PRICE]),
filter(all(Order), Order[Customer] = max(Order[Customer] )
)
)
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 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |