Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hola a todos
No estoy familiarizado con el script SQL y tengo un conjunto de datos donde se ha utilizado lo siguiente "
@row_number := CASO
CUANDO @prev_id = t1.id LUEGO @row_number + 1
Agregar una columna de índice:
Agregar una columna personalizada para el número de fila:
= Table.AddColumn(PreviousStep, "RowNumber", each if [ID] = try PreviousStep{[Index]-2}[ID] otherwise null then [Index] - try PreviousStep{[Index]-2}[Index] otherwise 1)
= Table.Group(PreviousStep, {"ID"}, {{"MaxCount", each List.Max([RowNumber]), type number}})
= Table.Join(MainQuery, "ID", AggregatedData, "ID")
= Table.AddColumn(PreviousStep, "FinalMinutes", each [Minutes] / [MaxCount])
@row_number := CASE
WHEN @prev_id = t1.id THEN @row_number + 1
Proporcione todo el SQL, faltando las instrucciones ELSE y END.
COMO max_counts EN J1.ID = max_counts.ID;
Eso es un SQL bastante avanzado. ¿Puede confirmar que esto se ejecuta en SSMS?
No me sorprendería que cosas como
...
@row_number := CASO
CUANDO @prev_id = t1.id LUEGO @row_number + 1
LO DEMÁS 1
TERMINA COMO 'COUNT',
@prev_id := t1.id
...
no se admitiría en el conector SQL de Power Query (a menos que lo declare como Value.NativeQuery tal vez).
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.