Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Column 1 (Project ID) contains repeating values.
Column 2 contains a series of values, maximum of 1 of each per project ID (column 1).
I want to add a new column that adds value of "Canceled" whenever column 2 contains "Canceled", but to mark that for all rows where Project ID matches.
Example from screenshot below:
Project ID: 64f1de08076108cf4638f61b4def8bdb
Print Statuses: Sent to print, Not submitted, Printing, Shipped, Canceled
Since this Project ID has Print Status of "canceled", I want to mark all rows with 64f1de08076108cf4638f61b4def8bdb as "Canceled" in a new column.
Alternatively,
Project ID: 64f9d23a01d07f63c698ec40de8e9f51 does NOT have the print status of "canceled", so the new column would be blank for all rows of this Project ID.
Solved! Go to Solution.
Hi @anwessel ,
Thank you @HotChilli for the quick response and solution. Here are some of my additions:
According to your first description, you can create such a calculated column:
Column 1 =
var _a=COUNTAX(FILTER('Table','Table'[project id]=EARLIER('Table'[project id]) && 'Table'[print status]="canceled"),[project id])
RETURN IF(_a>0,"canceled",[print status])
Based on your second description, you can create a calculated column like this:
Column 2 =
var _a=COUNTAX(FILTER('Table','Table'[project id]=EARLIER('Table'[project id]) && 'Table'[print status]="canceled"),[project id])
RETURN IF(_a=BLANK(),BLANK(),[print status])
Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @anwessel ,
Thank you @HotChilli for the quick response and solution. Here are some of my additions:
According to your first description, you can create such a calculated column:
Column 1 =
var _a=COUNTAX(FILTER('Table','Table'[project id]=EARLIER('Table'[project id]) && 'Table'[print status]="canceled"),[project id])
RETURN IF(_a>0,"canceled",[print status])
Based on your second description, you can create a calculated column like this:
Column 2 =
var _a=COUNTAX(FILTER('Table','Table'[project id]=EARLIER('Table'[project id]) && 'Table'[print status]="canceled"),[project id])
RETURN IF(_a=BLANK(),BLANK(),[print status])
Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, @v-tangjie-msft! Your column 1 calculation works great! This will get me where I need to go.
Create a calculated column.
Count the rows which have the same projectID as the current row with Print Status = "Canceled"
, for example,
var _Pid = theTable[Project ID]
var _CanceledRow = COUNTROWS(FILTER(theTable, theTable[Project ID] = _Pid && theTable[Print Status] = "Canceled"))
this should put 0 or 1 in _CanceledRow.
Write an IF statement that tests the value of _CanceledRow. If greater than 0 then "Canceled"
Please provide sample data in usable format (not as a screenshot).
User | Count |
---|---|
21 | |
19 | |
12 | |
10 | |
9 |
User | Count |
---|---|
30 | |
25 | |
15 | |
13 | |
10 |