cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RamiDaoud
Frequent Visitor

Changing row values based on another coumn value

Hello,

I have the following table and I need to know how i can  add new column (Type2) based on the following:

if one of the Type column values for the same BithdayID is Creative then all values in Type2 column for the same BirthdayID should be Creative otherwise Type2 should be Basic. The following table illustrates the disiered results in Type2 column.

Thank you 🙂

BirthdayIDTypeType2 (New Column)
Birth-1BasicBasic
Birth-1BasicBasic
Birth-4CreativeCreative
Birth-4BasicCreative
Birth-4BasicCreative
Birth-7BasicCreative
Birth-7CreativeCreative
Birth-7BasicCreative
1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

Hi @RamiDaoud ,

 

Create following column as follows:

Type2 Value = IF(COUNTROWS(FILTER(ALL(BirthData), (BirthData[BirthdayID] = EARLIER(BirthData[BirthdayID])) && BirthData[Type] = "Creative")) > 0, "Creative", "Basic")
 
You will get the required result as follows:
date2.png
If this helps please give Kudos and mark it as a Solution! 🙂
 
Thanks,
Pragati

Best Regards,

Pragati Jain

MVP logoDACertAzCert

LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

Hi @RamiDaoud ,

 

Create following column as follows:

Type2 Value = IF(COUNTROWS(FILTER(ALL(BirthData), (BirthData[BirthdayID] = EARLIER(BirthData[BirthdayID])) && BirthData[Type] = "Creative")) > 0, "Creative", "Basic")
 
You will get the required result as follows:
date2.png
If this helps please give Kudos and mark it as a Solution! 🙂
 
Thanks,
Pragati

Best Regards,

Pragati Jain

MVP logoDACertAzCert

LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Thank you! 

az38
Super User
Super User

Hi @RamiDaoud 

try a measure

Type2 = 
var _isCreative = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[BirthdayID]),'Table'[Type]="Creative")
RETURN 
IF(_isCreative>0,"Creative","Basic")

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors