Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mmh
Helper I
Helper I

calculated column from having only certain value

Hi,

there is application dataset contains ,application_id, activity name.. one application i having many multiple activiy name. so i would like have a calculated column if particular id having only certain activity name. here in below sample data  in every id's have activity name abc along others name, but id 2 only have only abc value. so calculated column should  be type B for id 2 other id type A. 

idactivity namecalculated column 
1abcType A
1xyzType A
1xyType A
2abcType B
2abcType B
3abcType A
3xyType A
3pyType A

Thanks in Advance

1 ACCEPTED SOLUTION
sjoerdvn
Super User
Super User

ok, then try:

calculated column = IF(CALCULATE(DISTINCTCOUNT('applications'[activity name]),ALLEXCEPT('applications','applications'[id]), 'applications'[activity name] <> "abc") >0, "Type A", "Type B")

View solution in original post

3 REPLIES 3
sjoerdvn
Super User
Super User

ok, then try:

calculated column = IF(CALCULATE(DISTINCTCOUNT('applications'[activity name]),ALLEXCEPT('applications','applications'[id]), 'applications'[activity name] <> "abc") >0, "Type A", "Type B")
mmh
Helper I
Helper I

Hi,
thanks! but i need consider value only i.e abc, as may be other id have distinct value with other value. 

sjoerdvn
Super User
Super User

you haven't mentioned the table name, so for the example below I used "applications":

calculated column = IF(CALCULATE(DISTINCTCOUNT('applications'[activity name]),ALLEXCEPT('applications','applications'[id])) = 1, "Type B", "Type A")

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.