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

Connecting Data From Different Files for Met/Not Met Conditions

Hi, 

 

I would like to count the Met/Not Met category I have developed for transit times and lead times. One complication is that these categories are on different excel files. 

 

Here's images of the model:

ABookbin_0-1626189917809.png

The file 'Ocean Shipment Tracker' has individual shipment data, including transit times, whereas 'Ocean LT' has planning lead times (named 85% Confidence here) according to lane name. The two files are connected using lane names. (This means there are multiple transit times associated with each lane name, but only one planning lead time associated with each lane name.)

 

Here's the code I am using right now (I am new to DAX and PowerBI, so if there is a more efficient way of doing this, please let me know!):

Ocean Met = 

Var a =

SUM('Ocean Shipment Tracking'[Actual transit time])

Var b =

SUM('Ocean LT'[85% Confidence])

Return

IF(a<b, "Met","Not Met")

This allows me to add a column in a table, but I can't figure out how to get a count of "Met" shipments:

ABookbin_1-1626190581730.png

(the third column 'Recommended Planning LT' is the '85% Confidence')

 

When I try to put this into a card, I get "Not Met". Under 'Fields', there is no option for 'Count'. 

ABookbin_2-1626190699001.pngABookbin_3-1626190785508.png

 

Any help on counting Met/Not Met would be greatly appreciated.

 

Thank you!

 

1 REPLY 1
lbendlin
Super User
Super User

That data model looks suspicious.  Please familiarize yourself with the concept of "fact" and "dimension" tables, and how they should be linked. Usually you do not want to directly connect two fact tables, and especially not via a M:M bidirectional connection.

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.

Top Solution Authors