Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello friends,
I am new to power bi . I am looking for a measure which can count the unmatched taskid From 2 tables .we need to compare table 1 with table 2 if there is a unmatch in table 2 (taskid ))then count should be 1 . It should count 1 time as there are dupicates .these 2 tables have a relationship with date table as 1 to many . i also have a visul filter on date . So if i filter dates between 1/jan to 30/mar it should give me a result as below .Please see below example and expected result.
table 1. Table 2
taskid date Taskid. Date
1d 24/mar
1d. 24/jan
1d 16/ july
2.x 22/april 3.z 24/dec
3.z 24/apr 3.z 22/april
4p 24/feb
4p 26/feb. 3.z. 24/dec
Expected result
Taskid. Count
1d 1
4p 1
Regards
Hi @Microblog321 ,
Check the measure, filter needs to be at least page level filter.
Measure =
var _mark = IF(SELECTEDVALUE(TableA[taskid]) in VALUES(TableB[Taskid]),1)
return
MAXX(TableA,_mark)
Best Regards,
Jay
Hello friend ,
thanks for your reply . I want to see values which are unmatched .
which are not in table 2. Can you pease help
Hi @Microblog321 ,
Modify the measure as below and it should work.
Thank you sir,
this works for me perfectly .But just want to ask . Now i tried to put another dimension called city . But the count still coming out to be 1 for every city . Basically every city have many task id . Is there any way i can count the taskid for every city . I mean it can aggregate accordingly if any other dinesions i put like city , area or state .
Hi @Microblog321 ,
That’s because we are using MAXX() in the formula, it will return the max value which is also 1.
You could use SUMX() or COUNTX() instead.
For example:
Hello Sir, Please see the image . I have tried the changes as per your dax code. it doesnt seem to work . please see the image.
Hello Sir, Please see the image . I have tried the changes as per your dax code. it doesnt seem to work . please see the image.
I am not getting the expected result
Hi,
Within your selected date range, task id "1d" appears in Table2. Therefore, why should it appear in the result?
Hello sir
Thanks for your reply. Taskid 1d is not present in the table 2.
Measure = var _mark = IF(SELECTEDVALUE(TableA[taskid]) in VALUES(TableB[Taskid]),1) return MAXX(TableA,_mark)
this measure seems to be working for me . But it selects all the matching value . Can you please make some changes in this measure where it can select only unmatched values . Like NOT in table 2 . Something like this
thank you
Can some one please help .
Taskid is text column will the max function work on text columns . Can you please help
Hi @Microblog321
I am assuming there is no relationship between both tables?
You could use a lookup function. You're measure would be
VAR task =
MAX ( Table1[taskid] )
RETURN
IF ( NOT ISBLANK ( LOOKUPVALUE ( Table2[Taskid.], Table2[Taskid.], task ) ), 1 )
This works with the sample data and gives the expected results.
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
Jeroen
Hello Friend,
thanks for your help . I am sorry i have made some changes in my question. Can you please help me with the aboove query
regards
@Microblog321
If you want to count the unmatches instead of the matches remove the NOT operator from the function and I would still work.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |