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.
Hello,
I have an issue with a measure named TotalValoresDRE. When used in conjunction with the Values column in the "Invoicing by employee" row, it doesn't display any data, although it should display the value 75952. Let me explain the data:
I have a table named dFormatoDRE, which is imported from Excel and consists of the following columns: Order, Rubric, Total.
I also have another table named fMovimentos, which includes the following columns: Account, Value.
Additionally, there's a table named dPlanoContas that has columns for Account and CodDRE.
I need to create a table that includes the following information: Rubric and Values. The Rubric column is derived from the Rubric column in the dFormatoDRE table, and the Values column is generated using a measure. This measure includes variables that sum the values in the Value column from the fMovimentos table, filtered by accounts. There is an active relationship between the dFormatoDRE table and the dPlanoContas table, linking dFormatoDRE.Order to dPlanoContas.CodDRE. There is also an active relationship between the dPlanoContas table and the fMovimento table, linked via dPlanoContas.Account and fMovimentos.Account.
The measure, designed to populate the rows of the matrix, should retrieve values from its rows based on the combination of Totaliza and Order, and it is as follows: [Here you can include the DAX formula you mentioned]
Tests I have already performed:
RETURN
SWITCH(
TRUE(),
vTotaliza = 0, vTotalCBL,
vTotaliza = 1 && vOrdem = 3, vNColaboradores,
vTotaliza = 1 && (vOrdem = 7 || vOrdem = 10), vSubtotalCBL,
vTotaliza = 2, "test"
)
If I create this measure:
Test Table =
"Text for testing"
And then in the measure:
RETURN
SWITCH(
TRUE(),
vTotaliza = 0, vTotalCBL,
vTotaliza = 1 && vOrdem = 3, vNColaboradores,
vTotaliza = 1 && (vOrdem = 7 || vOrdem = 10), vSubtotalCBL,
vTotaliza = 2, [Test Table]
)
It correctly returns the phrase.
Does anyone know how to resolve this issue?
-- na minha linguagem nativa;
Viva,
Tenho um probleme com uma medida TotalValoresDRE, que na conjugação da coluna Valores na linha Facturação por colaborador, não mostra nada, e deveria mostrar o valor 75952. Explico agora os dados:
1 Tenho uma tabela dFormatoDRE que é importada do excel e que tem as seguintes colunas: Ordem, Rubrica, Totaliza.
2 Tenho também uma tabela fMovimentos que tem as seguintes colunas: Conta, Valor
3 E a tabela dPlanoContas que tem as colunas Conta e CodDRE
Preciso de criar uma tabela que tenha as seguintes informações: Rubrica e Valores. A coluna Rubrica é a coluna Rubrica da tabela dFormatoDRE, e a coluna Valores é duma medida. Essa medida tem como variáveis outras medidas que somam os valores da coluna Valor da tabela fMovimentos, filtrada pelas contas. Há um relacionamento activo entre a tabela dFormatoDRE e a tabela dPlanoContas de dFormatoDRE.Odem para dPlanoContas.CodDRE. Há também um relacionamento activo entre a tabela dPlanoContas e a tabela fMovimento em dPlanoContas.Conta e fMovimentos.Conta.
A medida para preencher as linhas da matriz, deve ir buscar os valores das suas linhas consoante a conjugação de Totaliza e Ordem, e é esta:
Total Valores DRE =
VAR vTotaliza = SELECTEDVALUE(dFormatoDRE[Totaliza])
VAR vOrdem = SELECTEDVALUE(dFormatoDRE[Ordem])
VAR vTotalCBL = -SUM(fMovimentos[Valor])
VAR vSubtotalCBL = CALCULATE( [Total Movimentos CBL], FILTER( ALL(dFormatoDRE), dFormatoDRE[Ordem] <= MAX(dFormatoDRE[Ordem]) ) )
VAR vNatureza = SELECTEDVALUE(fMovimentos[Natureza])
VAR vNColaboradores = FORMAT( CALCULATE( COUNTROWS(dFuncionarios) - CALCULATE( COUNTROWS(dFuncionarios), dFuncionarios[Data Final] <> BLANK(), USERELATIONSHIP( dCalendario[Data], dFuncionarios[Data Final] )), FILTER( ALL( dCalendario), dCalendario[Data] <= MAX(dCalendario[Data] ) ) ) , 0)
VAR vRentColaborador = DIVIDE((CALCULATE( SUMX(fMovimentos, fMovimentos[Valor]), FILTER( dPlanoContas, dPlanoContas[Conta Razão] = "71" || dPlanoContas[Conta Razão] = "72" ) )), vNColaboradores, 0)
RETURN
SWITCH( TRUE(),
vTotaliza = 0, vTotalCBL,
vTotaliza = 1 && vOrdem = 3, vNColaboradores,
vTotaliza = 1 && (vOrdem = 7 || vOrdem = 10), vSubtotalCBL,
vTotaliza = 2, vRentColaborador )
Copia também a tabela excel dFormatoDRE, à qual acrescentei 2 colunas apenas para informação: a coluna Valores e Fórmulas apenas para perceber melhor os cálculos:
Ordem | Rubrica | Totaliza | Valores | Fórmulas |
1 | Facturação | 0 | 227856,52 | [Volume de Negácios] |
2 | Gastos com o pessoal | 0 | 45055,3 | [Gastos com pessoal] |
3 | Nº de colaboradores | 1 | 3 | [Funcionários Activos] |
4 | Facturação por colaborador | 2 | 75952,17333 | =E2/E4 |
5 | Gastos gerais | 0 | 15000 | [Gastos Gerais] |
6 | Depreciações | 0 | 1000 | [Depreciações] |
7 | Resultado operacional | 1 | 166801,22 | =E2-E3-E6-E7 |
8 | Outros rendimentos | 0 | 25 | [Outros Rendimentos] |
9 | Outros gastos | 0 | 785 | [Outros Gastos] |
10 | Resultado estimado | 1 | 166041,22 | =E8+E9-E10 |
11 | Erros | 0 |
Testes que já fiz:
1 Total as medidas usadas individualmente em cartão funcionam.
2 Se em vez de medida ou variá vel, usar uma string, e linha mostra essa palavra
3 Se fizer esta medida:
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 |
---|---|
97 | |
97 | |
82 | |
75 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |