Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Aurore
Frequent Visitor

Measure not affected by table rows

Hello, everyone!

 

I'm doing a measure that need to show me a value based on the total of a count. Depending on the total, it's going to show me diferent values, like: 

1 to 24 = 47,00
25 to 30 = 55,00
31 to 40 = 60,00
More than 41 = 65,00

When I use this measure on a card it works perfectly, it shows me the exactly value I need, like the image below:

value.PNG

 

But, when I try to use this on a TABLE it breaks the value per row. On the total it show correctly how the value is supposed to be, but on the rows it shows the minimum value. There's a way to make the measure show me the value in the total cell on the rows?

table.PNG

The measure I using is this one:

 

VALOR_COMISSAO = 
    VAR qtd_benef = 
        CALCULATE(
            DISTINCTCOUNT('power_bi gestao_contratos'[codigo_pessoa]),
            FILTER('power_bi gestao_contratos','power_bi gestao_contratos'[indica_plano_ant] = "N"),
                    'power_bi gestao_contratos','power_bi gestao_contratos'[SITUAÇÃO FATURA] = "PAGO",
            KEEPFILTERS('Tb_Calendário'[Competencia]),
            REMOVEFILTERS('Tb_Calendário'[Ano]))
    VAR valor_comissao = 
        CALCULATE(   
            MAXA('power_bi comercial_val_comiss_consult'[valor]),
            FILTER('power_bi comercial_val_comiss_consult',
                    'power_bi comercial_val_comiss_consult'[vidas_inicial] <= qtd_benef),
            GROUPBY('power_bi gestao_contratos','power_bi gestao_contratos'[nome_vendedor]),
            KEEPFILTERS('Tb_Calendário'[Competencia]),
            REMOVEFILTERS('Tb_Calendário'[Ano]))
    RETURN valor_comissao

 

 Basically this measure has two steps separated in two variables:

  • qtd_benef: this measure count the values that will be used in the next step. 
  • valor_comissao: the result of "qtd_benef" is the value used on the FILTER command to get the value of MAXA. 

the QTD_BENEF it the (34) and VALOR_COMISSAO is (60) that appears on the first image. 

 

Thanks in advance,

Daniel.

1 REPLY 1
lbendlin
Super User
Super User

Read about HASONEVALUE and use that in your measure.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.