Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Estou com uma dificuldade em listar as linhas mais recentes de uma tabela, estou usando essa fórmula, porem informar a quantidade de linhas a serem carregadas. Teria alguma outra que possa usar para calcular automaticamente as linhas mais recentes?
Fórmula: Table.MaxN([Dados], "concludedAt", 15 )
Dados: Tabela Agrupada
concluídoEm: Dados
15: Quantidade de linhas que uso como exemplo.
Solved! Go to Solution.
Resolvi criando uma nova coluna com o formulário mais recente e após isso usei a seguinte formula:
Resolvi criando uma nova coluna com o formulário mais recente e após isso usei a seguinte formula:
This is how you can filter each grouped tables for the max N rows in the concludedAt column.
BEFORE
AFTER
SCRIPT
let
SampleForGroupedTables = Table.TransformColumnTypes(Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTLRNzLVNzIwMlIwNLIyMCjIVYrViVYyQpVBSBijSCDpMEGRMEZImKJImEAlYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, concludedAt = _t]),{{"Column1", Int64.Type}, {"concludedAt", type datetime}}),
Source = #table(
{ "Date", "Data" },
{
{ 461894, SampleForGroupedTables },
{ 463207, SampleForGroupedTables },
{ 463205, SampleForGroupedTables }
}
),
FilterSubtables = Table.TransformColumns (
Source,
{
"Data",
(t) => Table.MaxN ( t, "concludedAt", 2 )
}
)
in
FilterSubtables
Please confirm what you are wanting to do. Filter the table shown in the screenshot for the max n values in the first column? Filter each grouped table for the max n values in a column named concludedAt (Can you include a screenshot of one of these tables? Is concludedAt a date column, datetime, etc). Are you wanting to do something else?
unitId seria o codigo da unidade.
Dados seria os dados agrupados daquela unidade.
Dentro de "Dados" tem:
unitId: codigo da unidade
EvaluationId: Codigo do formulário
ConcludedAt: Data da conclusão
ItemId: Pergunta do formulário
Resposta: Resposta do ItemId
Um formulário pode ter n perguntas com n respostas.
Preciso listar para cada unidade o formulário, as perguntas e as respostas mais recentes.
Exemplo:
unitId | evaluationId | concludedAt | itemId | Resposta |
461894 | 35443941 | 25/04/2022 | 7006145 | Não |
461894 | 35443941 | 25/04/2022 | 7006146 | Estava fechado |
461894 | 35443930 | 24/04/2022 | 7006145 | Sim |
461894 | 35443910 | 20/04/2022 | 7006145 | Sim |
Preciso que ele liste somente o ultimo formulário aplicado que foi dia 25/04/2022 no codigo do formulário 35443941.
Usei a formula Table.MaxN([Dados], "evaluationId", aqui preciso que calcule automaticamente )
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.