Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi!
I have different categories, labeled as 'PICKER BEHAVIOUR CLASS', these categories have a group of IDs, and there's a quantity of IDs that match these categories every week. For Example, the IDs 1, 2 and 3 in February 7th fell into this category, then the next week, February 14th, the IDs 1 and 2 fell into this category again. What I want to know is if there's a way I can count how many IDs repeated category. In this case, for the week of February 14th, the result should be 2.
I expect something like these to be the result.
Can anybody please help me?
Best Regards
Solved! Go to Solution.
Hi @Anonymous ,
Please refer the formula.
count_ =
VAR tmp =
CALCULATETABLE (
VALUES ( 'Table'[id] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[category] = SELECTEDVALUE ( 'Table'[category] )
&& 'Table'[week]
= SELECTEDVALUE ( 'Table'[week] ) - 1
)
)
RETURN
CALCULATE (
DISTINCTCOUNT ( 'Table'[id] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[week], 'Table'[category] ),
'Table'[id] IN tmp
)
)
Best Regards,
Jay
Hi @Anonymous ,
Please refer the formula.
count_ =
VAR tmp =
CALCULATETABLE (
VALUES ( 'Table'[id] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[category] = SELECTEDVALUE ( 'Table'[category] )
&& 'Table'[week]
= SELECTEDVALUE ( 'Table'[week] ) - 1
)
)
RETURN
CALCULATE (
DISTINCTCOUNT ( 'Table'[id] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[week], 'Table'[category] ),
'Table'[id] IN tmp
)
)
Best Regards,
Jay
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.