Forum Discussion
Filter Data
Hi!
I am new to power bi, I am laging with a problem i have 2 columns one contains Different Products like p1,q2,r1,s6,t4,a4,b5,c8,d9 etc... and in another other column i have cost of that Products now i need to create a new column that should contains only q,r,a,t,c COsts only remaining should display as 0
i am attaching sample data
| Products | cost | |
| p1 | 2 | |
| p2 | 6 | |
| q1 | 5 | |
| q1 | 7 | |
| p1 | 9 | |
| t1 | 3 | |
| r5 | 5 | |
| a4 | 4 | |
| a4 | 6 | |
| b6 | 4 | |
| b6 | 3 | |
| q2 | 0 | |
| s1 | 0 | |
| s1 | 6 | |
| c3 | 5 | |
| d3 | 89 | |
| d5 | 133 | |
| d5 | 45 | |
| c3 | 85 | |
| c3 | 25 |
Hi JAVED,
You can create a calculated column below:
Column = IF('Table1'[Products]="p1"|| 'Table1'[Products]="p2"||'Table1'[Products]="a4"||'Table1'[Products]="q2"||'Table1'[Products]="s1"||'Table1'[Products]="c3",'Table1'[cost],0)
Best Regards,
Qiuyun Yu
6 Replies
- JAVEDHelper I
sry it should display only p1,p2,a4,q2,s1,c3 values
- v-qiuyu-msftCommunity Support
Hi JAVED,
You can create a calculated column below:
Column = IF('Table1'[Products]="p1"|| 'Table1'[Products]="p2"||'Table1'[Products]="a4"||'Table1'[Products]="q2"||'Table1'[Products]="s1"||'Table1'[Products]="c3",'Table1'[cost],0)
Best Regards,
Qiuyun Yu- JAVEDHelper I
Thanks a lot v-qiuyu-msft