Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
In short my issue is I get wrong row and column total in a matrix if I use a measure to compute the value of the sales.
The data table is on the left.
On the right the first matrix has the totals correct.
The second matrix is not computing the totals right.
In this second matrix I used a measure like:
TotalSalesModified = if(SELECTEDVALUE(Sales[Item])="a" && SELECTEDVALUE(Sales[Month])="jan" ,99, sum(Sales[Sales]))
In the first one:
TotalSales = sum(Sales[Sales])
Can you help ?
Thanks in advance.
Solved! Go to Solution.
Hello @luisrossa8
For your question, I have created the following table.
Your original matrix looks like this:
You can use the following dax function to get the effect you want
TotalSalesModified =
SUMX(
Sales,
IF(
Sales[Item] = "aa" && Sales[Month] = "jan",
99,
Sales[Sales]
)
)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @luisrossa8
For your question, I have created the following table.
Your original matrix looks like this:
You can use the following dax function to get the effect you want
TotalSalesModified =
SUMX(
Sales,
IF(
Sales[Item] = "aa" && Sales[Month] = "jan",
99,
Sales[Sales]
)
)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thank you for your DAX.
Works fine as expected.
Five stars !!!!
@luisrossa8 You might need to use the SUMX and VALUES functions in your measure because of the aggregation measures do in the absense of those functions.
Alberto Ferrari explains it well here: https://youtu.be/6rgAkejrup8?si=b5wMMA8p3j2cR3pS
Thank you for your help.
I'll see, as your suggestion, what Alberto has to say.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
71 | |
37 | |
30 | |
28 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
36 |