Forum Discussion

carlosroston202's avatar
carlosroston202
New Member
1 year ago
Solved

Consumo Medio Fixo

Olá! Gostaria de uma ajuda com a medida Consumo Medio Fixo. Ela está exibindo a linha no gráfico para os meses que estão sem dados. Como posso ajustar esta medida de forma que não apareça a linha nos meses em que não esxitem dados?

Hello! I'd like some help with the Average Fixed Consumption metric. It's displaying a line on the graph for months with no data. How can I adjust this metric so that the line doesn't appear in months with no data?


Consumo Medio Fixo =
CALCULATE(
    AVERAGEX(
        SUMMARIZE(
            'dCalendário',
            'dCalendário'[Ano],
            'dCalendário'[Mês]),
    [Qtd Total]),
ALL('dCalendário'),
VALUES('dCalendário'[Ano])
)



Link do arquivo pbix:

https://drive.google.com/drive/folders/1YIuUa9X_AeTtxXaitQl-mjiy3NY0QF2j

  • Hi, 

    Please try something like below.

     

    Consumo Medio Fixo =
    IF (
        [Qtd Total],
        CALCULATE (
            AVERAGEX (
                SUMMARIZE ( 'dCalendário', 'dCalendário'[Ano], 'dCalendário'[Mês] ),
                [Qtd Total]
            ),
            ALL ( 'dCalendário' ),
            VALUES ( 'dCalendário'[Ano] )
        )
    )
    

3 Replies

  • Hi, 

    Please try something like below.

     

    Consumo Medio Fixo =
    IF (
        [Qtd Total],
        CALCULATE (
            AVERAGEX (
                SUMMARIZE ( 'dCalendário', 'dCalendário'[Ano], 'dCalendário'[Mês] ),
                [Qtd Total]
            ),
            ALL ( 'dCalendário' ),
            VALUES ( 'dCalendário'[Ano] )
        )
    )
    
  • V-yubandi-msft's avatar
    V-yubandi-msft
    Icon for Community Support rankCommunity Support

    Hi carlosroston202 ,

    Thanks for posting your query in the Microsoft Fabric Community. I've implemented the logic using a filtered average approach, and the output now reflects the behavior you described.

    The Average Fixed Consumption line is displayed only for months where [Qtd Toatal] contains valid data, and it's automatically suppressed in months without entries keeping the visual clean and accurate.

     

    For your reference, I've attached the PBIX file. Feel free to review it and let me know if you need any additional details or adjustments.

     

    Thanks for your prompt response Jihwan_Kim .

    Regards,
    Yugandhar.