I’ve probably been at the computer too much today. Issue is that I can’t come up with the correct number of “vendor names” associated with every PO Number – implicitly ignoring any blanks, as shown in this example. The correct answer (what I seek to show) should be “2” (not “3”):
In terms of the data model, I am having a hard time making heads or tails of what’s going on with that. At first, it looked like a snowflake structure, but the relationship to PO Stage Data runs in the wrong direction for that. Thus, the relationships are wired as if the PO Source is a bridge table, but that doesn’t square with the logical purpose of either table. In addition, if you use PO number from the dimension table in the table visual, it produces the wrong result.
Unfortunately, I think your DAX is going to continue to have major problems and/or require complex workarounds until you fix your model.
Do you want to see the row in the visual that has blank vendor name ? Or is it like the visual that you have shown you want exactly like that only the row that has blank vendor name should not get a count?
Very nicely done. Which measure ends up being “correct” will depend on the result @mdalton2100 is looking for, but I think your measure also underscores the data modeling point.
@mdalton2100 - When I first looked at this problem, I thought the solution would look something like this:
The fact that we both had to write such complex DAX to get to a simple result is typically a surefire sign that your data model is not set up correctly.
Hello Brian. Your suggestion is helpful. Yes, I do need to simplify my data model. The staging step is turning out to be extraneous and ultimately confusing to someone like yourself that is seeking to provide assistance for folks on this forum.
Anyway, to put it as simply as possible, I’m seeking to look-up (and count) those instances where the PO Table contains NRT values (embedded in the ‘NRT no.’ column) that match when looked up against the NRT table. Then, wherever the NRT values do match to the NRT table side: count the number of ‘Vendors’ associated with the matched NRT no. values … and by the same token, count matched values where there is no Vendor name at all. Hope that makes sense.