The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi, I want to create in Power query the next table
1) I need to group by the ones that have the same date and hour
2) in each group make an "IF" selecting just the ones that have "Yes" in the "Correct" column, for those that have several rows in the group and at least one "Yes", select the one with the lower value in "Cost"
3) for those that have just one row and the value is "No" or several rows and all of them are "No", select the one with the lower value in "Cost".
4) The result table will be 1 row per group, keeping all the others columns on it.
Thank you so much in advance
Regards
Solved! Go to Solution.
Hi See attached the power bi file
you need to do multiple group by's to get the desired result.
Proud to be a Super User!
please provide your data in text format.
Proud to be a Super User!
Sure @vanessafvg
Original table
Es Date Cost Correct x y z
05/10/2021 07:05:43 p. m. 10 No Example Example Example
05/10/2021 07:13:06 p. m. 5 No Example Example Example
05/10/2021 07:13:06 p. m. 4 No Example Example Example
06/10/2021 05:17:13 p. m. 6 Yes Example Example Example
06/10/2021 05:17:13 p. m. 5 Yes Example Example Example
06/10/2021 05:17:13 p. m. 2 Yes Example Example Example
06/10/2021 05:17:13 p. m. 1 No Example Example Example
Result table
Es Date Cost Correct x y z
05/10/2021 07:05:43 p. m. 10 No Example Example Example
05/10/2021 07:13:06 p. m. 4 No Example Example Example
06/10/2021 05:17:13 p. m. 2 Yes Example Example Example
Hi See attached the power bi file
you need to do multiple group by's to get the desired result.
Proud to be a Super User!