Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello!
So its been about 1 week and I can't seem to figure out how to do this and I just give up.
I just want to compare 1 column filtered twice and probably beyond that after I make sense of this.
Table Example
Item ID | CvP |
A | 2024 |
A | 2023 |
B | 2024 |
C | 2024 |
C | 2023 |
(Item ID where CvP = 2024) = (Item ID where CvP = 2023)
If true = Matched, Else = Unmatched
A is matched
B is unmatched because it didn't exist last 2023
C is matched
Desired Result
Item ID | Matching |
A | Matched |
B | Unmatched |
C | Matched |
Below is what I used on DAX
RD Filter =
IF(
(CALCULATE(
SUM('RAW DATA (INVOICE)'[Item ID]),'RAW DATA (INVOICE)'[CC vs PP] = "2024"))
=
(CALCULATE(
SUM('RAW DATA (INVOICE)'[Item ID]),'RAW DATA (INVOICE)'[CC vs PP] = "2023"))
, "Matched","Unmatched")
Solved! Go to Solution.
Hi @lancersc
Thanks for the reply from @_AAndrade, please allow me to provide another insight:
Here I create a measure:
RD Filter =
VAR _currentID =
SELECTEDVALUE ( 'RAW DATA (INVOICE)'[Item ID] )
RETURN
IF (
CALCULATE (
SELECTEDVALUE ( 'RAW DATA (INVOICE)'[Item ID] ),
FILTER (
ALLSELECTED ( 'RAW DATA (INVOICE)' ),
'RAW DATA (INVOICE)'[Item ID] = _currentID
&& 'RAW DATA (INVOICE)'[CvP] = 2024
)
)
= CALCULATE (
SELECTEDVALUE ( 'RAW DATA (INVOICE)'[Item ID] ),
FILTER (
ALLSELECTED ( 'RAW DATA (INVOICE)' ),
'RAW DATA (INVOICE)'[Item ID] = _currentID
&& 'RAW DATA (INVOICE)'[CvP] = 2023
)
),
"Matched",
"Unmatched"
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lancersc
Thanks for the reply from @_AAndrade, please allow me to provide another insight:
Here I create a measure:
RD Filter =
VAR _currentID =
SELECTEDVALUE ( 'RAW DATA (INVOICE)'[Item ID] )
RETURN
IF (
CALCULATE (
SELECTEDVALUE ( 'RAW DATA (INVOICE)'[Item ID] ),
FILTER (
ALLSELECTED ( 'RAW DATA (INVOICE)' ),
'RAW DATA (INVOICE)'[Item ID] = _currentID
&& 'RAW DATA (INVOICE)'[CvP] = 2024
)
)
= CALCULATE (
SELECTEDVALUE ( 'RAW DATA (INVOICE)'[Item ID] ),
FILTER (
ALLSELECTED ( 'RAW DATA (INVOICE)' ),
'RAW DATA (INVOICE)'[Item ID] = _currentID
&& 'RAW DATA (INVOICE)'[CvP] = 2023
)
),
"Matched",
"Unmatched"
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lancersc,
Could you provide a sample table with some data that represents your model, so I can take a look?
Proud to be a Super User!
Well, this is the only thing I am allowed to share rn. Not sure if it is any help.
On the left side of the Item ID should be the Matched/Unmatched.
Where is this column "CC vs PP" and their data?
Proud to be a Super User!
User | Count |
---|---|
94 | |
86 | |
78 | |
70 | |
63 |
User | Count |
---|---|
114 | |
101 | |
97 | |
66 | |
59 |