Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |