Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
I have below table, I want to create a new column that shows the default integration for the ID. i.e NewColumn below
If the there is Default_Flag = 1 for then use the Integration value from that row and fill the Newcolumn with that value in all rows for that ID
i.e for ID 001 first row has the default_Flag = 1 so will use value "A" from integrations column and fill in NewColumn for all the rows for 001 with "A"
ID 003 doesnt have any rows with default_Flag = 1 so will fill NewColumn as "No Default"
How do I do it?
ID | Integration | Default_Flag | NewColumn |
001 | A | 1 | A |
001 | C | 0 | A |
001 | B | 0 | A |
002 | B | 1 | B |
002 | D | 0 | B |
003 | A | 0 | No Default |
003 | B | 0 | No Default |
Thanks
Solved! Go to Solution.
Excel worksheet formula is enough
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @Anonymous
Here is a quick calcualted column that will give you what you're after!
Calculated Column =
VAR _1 = MAXX ( FILTER ( 'Table' , 'Table'[ID] = EARLIER ('Table'[ID] ) && 'Table'[Default Flag] = "1" ) , 'Table'[Integration] )
RETURN
IF ( ISBLANK ( _1 ) , "No Default" , _1 )
Output is as per below:
Hope this helps!
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Excel worksheet formula is enough
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@Anonymous Not sure I quite follow the rules on how to arrive at the values.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
73 | |
57 | |
38 | |
35 |
User | Count |
---|---|
83 | |
68 | |
59 | |
46 | |
45 |