Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
Below are 3 sample datasets, ordered by ValidFrom descending.
I'm trying to get Power BI to show in the far right column, the date since which a group of the same ID's is currently marked 1.
It is current when ValidTo = Blank.
However, in case there are two or more rows right below the current row that are also marked 1, Power BI should give the earliest ValidFrom date of those rows.
In case the most recent row is marked 0, the far right column should show no date:
How might this be achieved in a measure or calculated column?
Any suggestions would be very welcome.
Solved! Go to Solution.
Thank you very much@v-henryk-mstf for your suggestions. They were a good help although they did not completely meet all the requirements needed for this particular project.
I now created a duplicate table and added in this duplicate table, an index column grouped by ID:
https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
https://www.youtube.com/watch?v=jmzTHZK5z7g
To create this index I followed these steps from the above links:
That created this table as a duplicate from the original.
Next, I created in this duplicate table, a calculated column to refer to the previous row, and continued from there:
Hi @GKJARC ,
Try the formula like below:
Column =
MAXX (
FILTER ( Table1, Table1[Marked] = 1 && Table1[Vaildto] = BLANK () ),
Table1[Validfrom]
)
Column =
MAXX (
FILTER (
ALL ( Table2 ),
Table2[Marked] = 1
&& Table2[Vaildto] <> BLANK ()
&& Table2[Validfrom] >= EARLIER ( Table2[Validfrom] )
),
Table2[Validfrom]
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much@v-henryk-mstf for your suggestions. They were a good help although they did not completely meet all the requirements needed for this particular project.
I now created a duplicate table and added in this duplicate table, an index column grouped by ID:
https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
https://www.youtube.com/watch?v=jmzTHZK5z7g
To create this index I followed these steps from the above links:
That created this table as a duplicate from the original.
Next, I created in this duplicate table, a calculated column to refer to the previous row, and continued from there:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
102 | |
84 | |
79 | |
70 |
User | Count |
---|---|
120 | |
110 | |
95 | |
82 | |
77 |