Hi @rit372002 , we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.
Use the forum search to discover if your query has been asked before by another member.
When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.
Use the proper category that best describes your topic
Provide as much context to a question as possible.
Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.
For the date calculation you relied on the id1 = MAX( ‘Sales Order’[Customer-Item] ) but that field wasn’t available in your matrix visual… to hide all blanks I created the VAR BlankVal.
Max - date v2 =
VAR id1 = CONCATENATE( SELECTEDVALUE(Customer[Parent Retailer AB Number] ), SELECTEDVALUE( 'Item'[Item Number ID] ))
VAR BlankVal = SUMX( { [Net Qty 3YrsAgo] + [Net Qty 2YrsAgo] + [Net Qty LY] + [Net Quantity] }, [Value] )
VAR date1 =
CALCULATE(
MAX( 'Sales Order'[Day Date] ),
REMOVEFILTERS( 'Date' ),
'Sales Order'[Customer-Item] = id1
)
RETURN
IF( BlankVal <> BLANK(), date1 )
NOTE.
Your model is very, very, very extensive. From a best practice / performance perspective you should never bring more than you actually need (=use). Seeing you have a fact table with 100+ columns makes me wonder if you aren’t in fact building a “one model fits all” instead…
Hi @rit372002, we’ve noticed that no response has been received from you since the 7th of January. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!
@Melissa Thanks you so much! “Remove Filter” solves it, didn’t realize it could be that powerful!
Although I didn’t quite understand why you had to change from bi-direction to single direction and did you make the table as date table for “Best Practices” purposes or was there a technical reason for the solution? Thanks for the tip on keeping Fact table small column wise as well!!!
Unless you really understand the impact of a bi-directional relationship AND there is no alternative then be my guest and use it. In all other cases don’t. Two main reasons are ambiguity and performance.
Mark as Date table is a best practice.
This will validate your Date table but more importantly prevent the creation of those hidden auto date/time tables that cause bloat of the model - otherwise for each date field in your model a separate hidden date table is created for you. If you have 14 date fields you get a free bonus of 14 hidden date tables. So when you see that suffix .[Date] appear for example you know you have hidden date tables in your model…
Another important reason to mark as a date table is if you want to use DAX time intelligence functions.
Hi @rit372002, did the response provided by @Melissa help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark the thread as solved. Thanks!