Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I am new to DAX functionality and I was wondering if there were functions and measures I could create to make the following psuedo code possible:
If (Table 1 Value exists in Table 2) {
If (Table 1 Value's Entry Date is after Table 2 Value's Entry Date) {
[Do Something]
}
}
The main issues I have are in regards to setting up the conditionals. Are there DAX functions to see if Values exist in different tables? And is there a logical comparison between dates to see if one date is after another date?
Thanks
Hi, @Anonymous
I tried to create a sample pbix file based on the explanation.
I am not sure whether I understood your question correctly, but please check the below picture and the sample pbix file.
Table1 Value exists in Table2 =
IF (
ISFILTERED ( Dim_Values[Value] ),
SWITCH (
TRUE (),
SELECTEDVALUE ( Table1[Value] )
IN CALCULATETABLE ( VALUES ( Table2[Value] ), ALL ( Dim_Values ) )
&& SELECTEDVALUE ( Table1[Date] ) > SELECTEDVALUE ( Table2[Date] ), "Yes / later than table2",
SELECTEDVALUE ( Table1[Value] )
IN CALCULATETABLE ( VALUES ( Table2[Value] ), ALL ( Dim_Values ) )
&& SELECTEDVALUE ( Table1[Date] ) <= SELECTEDVALUE ( Table2[Date] ), "Yes / earlier(or equal) than table2",
SELECTEDVALUE ( Table1[Value] ) = BLANK ()
&& SELECTEDVALUE ( Table2[Value] ) <> BLANK (), "Only Table2",
NOT (
SELECTEDVALUE ( Table1[Value] )
IN CALCULATETABLE ( VALUES ( Table2[Value] ), ALL ( Dim_Values ) )
), "Only Table1"
)
)
https://www.dropbox.com/s/r72e077i33gpve9/kesera.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |