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 there, I'm going to try and explain this as simply as possible. I have this matrix table built:
From a separate data table, I need to to account for this negative count and negative sum from the Auto row of the above table.
I can't figure out how to incorporate this negative count/sum into the Auto group row ONLY. I can't seem to isolate the Auto row. Any measure I create affects all of the other rows (Marine, Motorcycle, Quad, RV/ Shareback) also, no matter what I try.
Thank you for your time, this forum has helped me so much in the past!
Solved! Go to Solution.
Hi @mclawler,
The condition should be placed before the calculation. I didn't understand the logic of the transformation from 35 to 345, but I can still demonstrate the logic for manipulating the "Auto" category versus other categories.
The measure can use the following logic:
Test =
IF(
SELECTEDVALUE('Table'[Category]) = "Auto",
SUM('Table'[Value]) - SUM('Table 2'[Value]),
SUM('Table'[Value])
)
The pbix with the example is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @mclawler
Modify the formula to :
The updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
For your reference.
Measure = SUMX(FILTER('Table','Table'[#]<0 && 'Table'[Column]="Auto"),'Table'[#])
This is what I have so far but it's adding too many to Auto, all other rows still count normal as they should but instead of -35 it's like -345 to Auto. It's almost like it's now disregarding my DateTable slicer for the Collateral count.
Hi @mclawler
You can use selectedvalue function , like :
if(selectedvalue(category) = "Auto", abc,xyz)
guide for using selectedvalue() here :
https://www.sqlbi.com/articles/using-the-selectedvalue-function-in-dax/
For more detailed suggestion
please share a pbix or some dummy data that keeps the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
It won't allow me to use the IF statement and I'm not sure why? Maybe cause I'm building a measure and not a column?
This is what I have so far but it's adding too many to Auto, all other rows still count normal as they should but instead of -35 it's like -345 to Auto. It's almost like it's now disregarding my DateTable slicer for the Collateral count.
Hi @mclawler,
The condition should be placed before the calculation. I didn't understand the logic of the transformation from 35 to 345, but I can still demonstrate the logic for manipulating the "Auto" category versus other categories.
The measure can use the following logic:
Test =
IF(
SELECTEDVALUE('Table'[Category]) = "Auto",
SUM('Table'[Value]) - SUM('Table 2'[Value]),
SUM('Table'[Value])
)
The pbix with the example is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
I do have a new issue however, my Total row isn't accurate:
The Total row should = 23,865
Please advise 🙂
Hi @mclawler
Modify the formula to :
The updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Any idea why this measure would be dropping the Motorcycle row data? It keeps the Auto & RV data but drops Motorcycle row data:
This is the Measure I'm using:
That worked perfectly, absolutely amazing. Thank you so much!
Happy to help 🙂
It worked!!!!!! Thank you so much!!!!
User | Count |
---|---|
79 | |
74 | |
44 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
52 | |
50 | |
46 |