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
heathernicole
Continued Contributor
Continued Contributor

HOW?Calculated Column: if "this column" matches "this column" then display "this column" else "None"

I am trying to create a calculated column that looks at a couple of different columns - if they match, then display the number, if there's no match - display "No PO".

 

Here's an example: (there are actually thousands and thousands of rows for these two columns)

 

Type                          Number

Purchase Order          12345

Sales Order                 34567

Sales Order                12345

Sales Order                45769

Purchase Order          34567

Purchase Order          12567

 

 

What I need to get:

 

Type               Sales Order #     POs

Sales Order     34567                34567

Sales Order     12345                12345
Sales Order     45769                 "NO PO"

 

 

ANY assitance on this will be GREATLY appreciated!! 

 

The script I've created gets this error: DAX Comparison operations do not support comparing values of type Text.

 

Not very savvy with DAX yet...

 

Thanks in advance!!! 

~heathernicoale
3 ACCEPTED SOLUTIONS
Sean
Community Champion
Community Champion

@ImkeF Thanks! This works great!

 

One thing I'll say if anyone is trying this don't rename a step "Filter Table" with a space

 

I don't know why it doesn't work with a space - use "FilteredTable" no space

 

Otherwise works great! Thanks again!

 

View solution in original post

You have to create a Relationship to the new Lookup Table you've just created...

 

View solution in original post

@ImkeF @Sean 

 

Here's what I had to do: 

the actual table I'm working with has a lot more columns and more values for that "Type" column. So what I did was 

  1. Duplicated the core table - renamed it
  2. Filtered for ONLY Sales Orders and Purchase Orders
  3. Created a Reference table 
  4. THEN used the video to finish the rest (merging queries).

In order to correct the date issue - I redid the steps and didn't take out any columns. Apparently one of the columns was a link to the Calendar table.

 

Once I did that - I manually created the relationship between the Referenced table (with all the calculations and filters) and the Calendar table. All slicers work and the data is correct!! 😄 

 

THANK YOU! THANK YOU! THANK YOU!

 

I've been working on this one for about 2 1/2 weeks so this was a huge win. Greatly appreciated the collaboration and desire to help! Thanks again!

~heathernicoale

View solution in original post

37 REPLIES 37

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.