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.
I have a matrix displaying a series of columns, with the last column being a count of unique account numbers (summarizing on countd of those account numers)...So each row should have a 1 in that field. However, I would like to be able indicate a -1 if something cancelled. So I have a column that says if something is cancelled and is blank if it isn't. How can I get that COUNTD of account numbers in that row to be -1 for cancelled and 1 for non-cancelled. I tried using IFs but they don't work
Solved! Go to Solution.
Hi @paguy215
Thanks for the reply from @Learner27 , please allow me to provide another insight:
My sample:
If you don't necessarily want to use a calculated column, try creating the following measure:
Measure = IF(MAX([cancelled]) = BLANK(), CALCULATE(DISTINCTCOUNT('Table'[account]), ALLEXCEPT('Table', 'Table'[account])), -1)
Output:
If this sample data is structurally different from the one you are using, please do not hesitate to mention it and I will modify it.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @paguy215
Thanks for the reply from @Learner27 , please allow me to provide another insight:
My sample:
If you don't necessarily want to use a calculated column, try creating the following measure:
Measure = IF(MAX([cancelled]) = BLANK(), CALCULATE(DISTINCTCOUNT('Table'[account]), ALLEXCEPT('Table', 'Table'[account])), -1)
Output:
If this sample data is structurally different from the one you are using, please do not hesitate to mention it and I will modify it.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I belive it should work when you have created a calculated column. Could you provide your Sample PBIX file by hiding all the sensitive Data
Hi have you tried to create a new calculated column in your data table that assigns 1 for non-cancelled accounts and -1 for cancelled accounts.
Yes but that doens't work because there are multiple rows for each account ID in some cases ... IE maybe 3 or 4 regular ones plus the one record that's cancelled, so the matrix sums them, showing 3 positive and -1 negative...I would want only one distinct record for positive and for cancelled
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 | |
7 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
9 |