cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Calculated Column missing values if "IF" Condition not satisfied.

Hi All,

 

I am finding a solution for IF Condition, saw thousands of threads but din't get the answer.

Please help me, I am stuck because of this calculation.

 

Below is my table:-

Data.PNG

 

I want a column for days on sales, where if inventory<>current mnth values, it should go to next condition,

but as above, if 1260<>805, it is giving a blank,

the above calculation is a measure. but i want it in a column as i need the column for lookup and further calc as well.

 

Please find below link for my PBIX file.

https://www.dropbox.com/s/fs6uogt1ggs6qvm/try1.pbix?dl=0

 

My main concern is to get the calculation in a column and not measure.

And also why if the first condition is not satisfied, it does not take into consideration the second or third condition.

 

Urgent Help Needed!

I am stuck here from days.

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: Calculated Column missing values if "IF" Condition not satisfied.


@Ayesha28 wrote:

 

I want a column for days on sales, where if inventory<>current mnth values, it should go to next condition,

but as above, if 1260<>805, it is giving a blank,

the above calculation is a measure. but i want it in a column as i need the column for lookup and further calc as well.

 

 


Your condition is not checking <> it is doing [inv] <= cmnthe and 1260 <= 805 is false so it falls through to the next condition which is looking for a value of 3 months ago which does not exist and since there are not other conditions to check the switch returns a blank value.

Highlighted
Helper I
Helper I

Re: Calculated Column missing values if "IF" Condition not satisfied.

you need to change the condition into 

[Inv]>< cmnthe
 
but i suggest doing it on power query its way easier, you just need to add a personalized column with a code like this:
If [inv] >< [total Weight] then Duaration.Days ( [date1], [date2]) else null

Helpful resources

Announcements
June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors