Share via

PowerBI Custom Column Mutiple Condition

Jozefien Voorhuis 1 Reputation point
2020-07-19T11:11:51.65+00:00

Hi there,

I need to insert a custom column in PowerBI. The column should return the value of an existing column 'ava_presalesamount' if 2 conditions are met: the column 'promotie.ava_name needs to contain "DGO" and the date needs to be before today. If this is not the case, the column needs to return the value of another column 'ava_builtondsiplay'.

I used the following code:

if Text.Contains([Promotie.ava_name], "DGO") and ([Date]< DateTime.Date()) then [ava_presalesamount] else [ava_builtondisplay].

For all the rows where 'promotie.ava_name' does contain "DGO", an Error appears. For the other rows 'ava_builtondsiplay' is returned, as should be the case.

Could someone help me out here?

Community Center | Not monitored

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-07-19T11:50:42.88+00:00

    Power Bi is not currently supported here on QnA. They're actively answering questions in dedicated forums here.
    https://community.powerbi.com/
    https://social.technet.microsoft.com/Forums/en-US/home?category=powerbi

    --please don't forget to Accept as answer if the reply is helpful--


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.