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

DAX Formula Help lookup

Hi, i am trying to work out if a customer ID had migrated from Cloud to on Prem. A customer ID would come up multiple times for cloud or on prem. What i need to do as be able to put something in place to say IF Customer has Cloud AND On Prem then output migrated. The table below is an example of what i am trying to accomplish;

 

Capture.JPG

2 ACCEPTED SOLUTIONS
PattemManohar
Community Champion
Community Champion

@Anonymous Please try this..

 

Migrated = 
VAR _CloudCheck = LOOKUPVALUE(Test63[CloudorPrem],Test63[CustomerID],Test63[CustomerID],Test63[CloudorPrem],"Cloud")
VAR _OnPremCheck = LOOKUPVALUE(Test63[CloudorPrem],Test63[CustomerID],Test63[CustomerID],Test63[CloudorPrem],"On Prem")
RETURN IF(_CloudCheck<>BLANK() && _OnPremCheck <> BLANK(),TRUE(),FALSE())

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may also refer to the DAX below.

Column =
CALCULATE (
    DISTINCTCOUNT ( Table1[Cloud or Prem] ),
    FILTER ( Table1, Table1[Customer ID] = EARLIER ( Table1[Customer ID] ) )
)
    = 2
Community Support Team _ Sam Zha
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

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may also refer to the DAX below.

Column =
CALCULATE (
    DISTINCTCOUNT ( Table1[Cloud or Prem] ),
    FILTER ( Table1, Table1[Customer ID] = EARLIER ( Table1[Customer ID] ) )
)
    = 2
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PattemManohar
Community Champion
Community Champion

@Anonymous Please try this..

 

Migrated = 
VAR _CloudCheck = LOOKUPVALUE(Test63[CloudorPrem],Test63[CustomerID],Test63[CustomerID],Test63[CloudorPrem],"Cloud")
VAR _OnPremCheck = LOOKUPVALUE(Test63[CloudorPrem],Test63[CustomerID],Test63[CustomerID],Test63[CloudorPrem],"On Prem")
RETURN IF(_CloudCheck<>BLANK() && _OnPremCheck <> BLANK(),TRUE(),FALSE())

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

@PattemManohar Thank you very much for the swift reply i am getting the following error with this 

 

Column 'CustomerID' in table 'CustomerOrderItems' cannot be found or may not be used in this expression.

 

Is there naything i can do to get past this error?

 

@Anonymous Please make sure the column names are same as it was present in your table. I might have different names for my test data. 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




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.