Reputation: 378
I have my data(file name - Data) which I have imported in power bi with a column named values
values |
---|
ext |
int |
safety_int |
outside_training |
gap_fill_int |
so it is a large data, and it contains more than 2k categories , what I want is, to create a new column in power bi where blanks should be replaced with target_emp, and all other values(ext,int,gap_filling_int etc.) should be replaced with non_target_emp. Please help me to do that in power bi.
Upvotes: 1
Views: 2100
Reputation: 4346
#1 DAX
calculatedColumn= SWITCH(TRUE(), Data[Column1]=BLANK(),"target_emp", "non_target_emp")
#2 using PBI's binning
go to report view->click on the table->column name-> New Group
Upvotes: 0
Reputation: 2666
You could add a conditional column in the data model (sorry that I dont have an English screenshot for this):
Upvotes: 0
Reputation: 3741
In powerbi transform ->
Add Column:
if Text.Trim([category]) = "" then "target_emp" else "non_target_emp"
Upvotes: 2