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.
Hi Experts
i am trying to work out where the TASK ID Project ID are consective for two or more rows then return a value of one in a new column other wise 0. See below. not sure on how to do the DAX
Task ID | Project ID | Expected Result |
1239498 | 1022 | 1 |
1239498 | 1022 | 1 |
1239498 | 1809 | 0 |
1239498 | 10566 | 0 |
1239446 | 1265 | 1 |
1239446 | 1265 | 1 |
1239446 | 19465 | 0 |
Solved! Go to Solution.
Hello @Anonymous , I am not sure if you are looking for this. I have created three columns so that you can understand clearly.
Output looks like this:
Three columns DAX will be like this:
Key Column = 'Table'[Task ID]&'Table'[Project ID]
Counting = CALCULATE(COUNT('Table'[Key Column]),ALLEXCEPT('Table','Table'[Key Column]))
Final Result = IF('Table'[Counting] = 2,1,0)
If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!
Hello @Anonymous , I am not sure if you are looking for this. I have created three columns so that you can understand clearly.
Output looks like this:
Three columns DAX will be like this:
Key Column = 'Table'[Task ID]&'Table'[Project ID]
Counting = CALCULATE(COUNT('Table'[Key Column]),ALLEXCEPT('Table','Table'[Key Column]))
Final Result = IF('Table'[Counting] = 2,1,0)
If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!
This is doable but not trivial. Also, you'll need an index or some other column (e.g., date) to tell if two rows are consecutive. Do you have that? What do you plan to do with this new column once you have it? There may be a simpler way to get to that result. If this is needed, does it need to be a DAX solution (or could it be done in your query with M)?
Pat
Hi ppm1, my end result is to filter out the values which do not meet the criteria. that;s it. I have an index column not a date column, M query if possible. other wish DAX so i can apply it as a filter at Page level
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 |
---|---|
75 | |
74 | |
57 | |
38 | |
33 |
User | Count |
---|---|
71 | |
65 | |
58 | |
50 | |
47 |