Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Need to convert the excel formula into Power BI for categorizing data.

Is there any way to create a column which will display only two values i.e "ClientSide", "OurSide" based on Colum A(ticketid) and ColumnB(interactionValue.)

-For Example: if ticketId(ColumnA) 5733199 has Interaction(columnB) as "Resolution" or "Resolved" on b3 and it has also value "Requested info from Client"on b6 then i want a column stating a value "ourSide" , if not the value should state "ClientSide" but it should check all the related row in InteractionValue Column for ticketId 5733199.

-This loop should run till the end of Column A(TicketId) and give result Accordingly.

 

here is an example worksheet to work upon, kindly assist with these if its possible on excel.

 

Excel Formula: =IF(A2<>A1,IF(AND(COUNTIFS(A:A,A2,B:B,"Resolution")+COUNTIFS(A:A,A2,B:B,"Resolved")>0,COUNTIFS(A:A,A2,B:B,"Requested info from Client")>0),"OurSide","ClientSide"),"")

 

Need to convert the above Formula for PowerBI and want the output column C as shown in image. is it possible ? 

 

e56a24f4-0b48-4a39-89ef-1a93575c05d0 (1).PNG

2 ACCEPTED SOLUTIONS
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

You can try this DAX formula as a calculated column.

 

Column =
VAR hasResolution =
    LOOKUPVALUE (
        Table187[Interaction],
        Table187[TicketID], [TicketID],
        Table187[Interaction], "Resolution"
    )
VAR hasResolved =
    LOOKUPVALUE (
        Table187[Interaction],
        Table187[TicketID], [TicketID],
        Table187[Interaction], "Resolved"
    )
VAR hasRIFC =
    LOOKUPVALUE (
        Table187[Interaction],
        Table187[TicketID], [TicketID],
        Table187[Interaction], "Requested info from Client"
    )
RETURN
    IF (
        NOT ( ISBLANK ( hasResolution ) && ISBLANK ( hasResolved ) )
            && NOT ISBLANK ( hasRIFC ),
        "OurSide",
        "ClientSide"
    )

Need to convert the excel formula into Power BI for categorizing data.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
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

Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula in the PowerPivot window

 

=if(AND(CALCULATE(COUNTROWS(Data),FILTER(Data,(Data[Interaction]="Resolution"||Data[Interaction]="Resolved")&&Data[TicketID]=EARLIER(Data[TicketID])))>0,CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Interaction]="Requested info from client"&&Data[TicketID]=EARLIER(Data[TicketID])))>0)=TRUE(),"Our side","Client side")

You may download the workbook from here.  As you can observe in the image below, this will show client side/our side in all cells of that column.  Can you live with this?

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula in the PowerPivot window

 

=if(AND(CALCULATE(COUNTROWS(Data),FILTER(Data,(Data[Interaction]="Resolution"||Data[Interaction]="Resolved")&&Data[TicketID]=EARLIER(Data[TicketID])))>0,CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Interaction]="Requested info from client"&&Data[TicketID]=EARLIER(Data[TicketID])))>0)=TRUE(),"Our side","Client side")

You may download the workbook from here.  As you can observe in the image below, this will show client side/our side in all cells of that column.  Can you live with this?

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you very much for this, this too worked out as expected.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

You can try this DAX formula as a calculated column.

 

Column =
VAR hasResolution =
    LOOKUPVALUE (
        Table187[Interaction],
        Table187[TicketID], [TicketID],
        Table187[Interaction], "Resolution"
    )
VAR hasResolved =
    LOOKUPVALUE (
        Table187[Interaction],
        Table187[TicketID], [TicketID],
        Table187[Interaction], "Resolved"
    )
VAR hasRIFC =
    LOOKUPVALUE (
        Table187[Interaction],
        Table187[TicketID], [TicketID],
        Table187[Interaction], "Requested info from Client"
    )
RETURN
    IF (
        NOT ( ISBLANK ( hasResolution ) && ISBLANK ( hasResolved ) )
            && NOT ISBLANK ( hasRIFC ),
        "OurSide",
        "ClientSide"
    )

Need to convert the excel formula into Power BI for categorizing data.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Thank you very much for this, it worked as expected.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.