Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Pessoal, tenho a modelagem acima.
Preciso fazer a contagem da quantidade de registros em "tb_BaseDados" e tenho a seguinte medida
O problema é que ao inserir a segunda restrição, dá erro: "Um único valor para a coluna 'Conteudo' na tabela 'tb_Conteudo' não pode ser determinado.
Solved! Go to Solution.
Hi @educrocha_agu,
Not sure how you create relationships for the tables in your model. But you may try this Measure.
RecordsSIM =
VAR res =
CALCULATE (
COUNT ( 'tb_BaseDados'[pk] ),
FILTER (
'tb_BaseDados',
'tb_BaseDados'[dtRelatorio] >= DATEVALUE ( "01/05/2021" )
&& MAX ( 'tb_Conteudo'[Conteudo] ) = "SIM"
)
)
RETURN
res
RecordsSIM with proper total =
VAR midT =
ADDCOLUMNS ( VALUES ( tb_BaseDados[pk] ), "val", [RecordsSIM] )
RETURN
SUMX ( midT, [val] )
Then, the result looks like this.
Also, attach the pbix as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know how. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi @educrocha_agu,
Not sure how you create relationships for the tables in your model. But you may try this Measure.
RecordsSIM =
VAR res =
CALCULATE (
COUNT ( 'tb_BaseDados'[pk] ),
FILTER (
'tb_BaseDados',
'tb_BaseDados'[dtRelatorio] >= DATEVALUE ( "01/05/2021" )
&& MAX ( 'tb_Conteudo'[Conteudo] ) = "SIM"
)
)
RETURN
res
RecordsSIM with proper total =
VAR midT =
ADDCOLUMNS ( VALUES ( tb_BaseDados[pk] ), "val", [RecordsSIM] )
RETURN
SUMX ( midT, [val] )
Then, the result looks like this.
Also, attach the pbix as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know how. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
25 | |
20 | |
20 | |
14 | |
13 |
User | Count |
---|---|
43 | |
37 | |
25 | |
24 | |
22 |