Reply
Highlighted
Regular Visitor
Posts: 31
Registered: ‎08-22-2018
Accepted Solution

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

 Productscost
 p12
 p26
 q15
 q17
 p19
 t13
 r55
 a44
 a46
 b64
 b63
 q20
 s10
 s16
 c35
 d389
 d5133
 d545
 c385
 c325

Accepted Solutions
Moderator
Posts: 9,474
Registered: ‎03-06-2016

Re: Filter Data

[ Edited ]

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)

 

q7.PNG

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Attachment

All Replies
Regular Visitor
Posts: 31
Registered: ‎08-22-2018

Re: Filter Data

sry it should display only p1,p2,a4,q2,s1,c3 values

Moderator
Posts: 9,474
Registered: ‎03-06-2016

Re: Filter Data

[ Edited ]

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)

 

q7.PNG

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Attachment
Regular Visitor
Posts: 31
Registered: ‎08-22-2018

Re: Filter Data

Thanks a lot @v-qiuyu-msft

Regular Visitor
Posts: 31
Registered: ‎08-22-2018

Re: Filter Data

Can we display last 6 months data in graph even.even thought there is no data for 3 months

Example  i need to diaplay last 6 months data when i write a query it is dispalying data from today to feb-23-2018, But in my data base i don't have may,June,July,Agust data,in the bar graph it is shown only feb ,Mar,apr in bar graph. But i need to display may,june,july names also even it is empty.

Moderator
Posts: 9,474
Registered: ‎03-06-2016

Re: Filter Data

Hi @JAVED,

 

This is a different issue from the original one. I would suggest you post a new thread in Power BI desktop forum with some dummy data and clarify corresponding desired results. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regular Visitor
Posts: 31
Registered: ‎08-22-2018

Re: Filter Data

Thank you @v-qiuyu-msft