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
Adak
Frequent Visitor

Calculate unique table from existing

Hi,

 

 It should be easy, but I have never done similar thing and can't find similar example. Main thing is that I have a table of orders, and only with purchase order VendorID value is present, later operations with that order lacks VendorID. Business wants to have information about other operations and slice it by Vendor. So my thought is to make a calculated table with distinct Orders and calculated VendorID for Order and make relationship with Orders table. That should solve business need, but I'm not sure how to calculate this table, or if calculated table would be the best approach.

 

I have a table like this:

snip_20160927131322.png

 

Resulting calculated table should be like this: 

snip_20160927131346.png

 

 Tried some DAX formulas with SUMMARIZE, but don't know how to filter out only one value ignoring blank ones (in reality Vendor ID is Text field, not number)

 

Would be great if someone would share DAX formula i should use to achieve this, or a better method to calculate this.

 

 

 

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

Hi @Adak

 

Specifically for your case you can solve trying this:

 

 

Tabla = SUMMARIZE(FILTER('Table','Table'[OperationType]="In"),'Table'[OrderID],'Table'[VendorID])




Lima - Peru

View solution in original post

3 REPLIES 3
Vvelarde
Community Champion
Community Champion

Hi @Adak

 

Specifically for your case you can solve trying this:

 

 

Tabla = SUMMARIZE(FILTER('Table','Table'[OperationType]="In"),'Table'[OrderID],'Table'[VendorID])




Lima - Peru
Adak
Frequent Visitor

Thanks @Vvelarde

 

Looks so simple then looking at this 🙂

Greg_Deckler
Super User
Super User

I think you would have better luck creating another query against your data source that filtered for Vendor ID and did a distinct on Order ID. Then you would have the table you want and be able to relate it back to your Order table.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.