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

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.

Reply
Dominok123
Frequent Visitor

New 'Yes/No' column depending on changes to a value associated with an ID

Hey guys,

I am struggling with trying and getting the third column 'Change' (in the table below) working in Power BI. 

 

Basically I need to work out if the value column has changed two or more times for each ID. So values that change once within the same ID would not count - only if the value changes 2 or more times per each ID.

 

In the table below you see that:

ID 1 value changed twice so that = 'Yes'

ID 2 did not change = 'No'

ID 3 value changed once so that = 'Yes'

 

Any help would be much appreciated.

 

Table1:

IDValueChange
11000Yes
11000 
11200 
11800 
2720No
2720 
3900No
3900 
31000 

 

1 ACCEPTED SOLUTION

@Dominok123 

 

You can use this calculated column

 

Column =
IF (
    CALCULATE ( DISTINCTCOUNT ( Table1[Value] ), ALLEXCEPT ( Table1, Table1[ID] ) ) > 2,
    "yes",
    "no"
)

DC.png


Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@Dominok123 

 

So you can count distinct values per each ID and if they are greater than 2...answer should be "yes"...

Isn't it?


Regards
Zubair

Please try my custom visuals

Yeah, I just have no idea how to do it even though this should be really basic. Like I have no idea what the DAX formula for this would be.

@Dominok123 

 

You can use this calculated column

 

Column =
IF (
    CALCULATE ( DISTINCTCOUNT ( Table1[Value] ), ALLEXCEPT ( Table1, Table1[ID] ) ) > 2,
    "yes",
    "no"
)

DC.png


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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