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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
carolinesbp_
Regular Visitor

Calculate the 6-month proportional targetcalculate

Hi guys,

I have calculated the proportional target up to the day before today, but I would like to calculate this proportional target for 6 months, up to June.

is a calculated column

MetaProporcional =
                    var dia = SUMx(FILTER('Calendário', and(and('Calendário'[Data]>='01. Meta'[Primeiro dia], 'Calendário'[Data] <= '01. Meta'[Ultimo dia]), and('Calendário'[mês] = '01. Meta'[Mês],'Calendário'[ano] = '01. Meta'[Ano]))),'Calendário'[DIaUtil])

                   var metaproporcional = DIVIDE('01. Meta'[Meta],dia)* SUMx(FILTER('Calendário', and(and('Calendário'[Data]>='01. Meta'[Primeiro dia], 'Calendário'[Data] <= TODAY()-1), and('Calendário'[mês] = '01. Meta'[Mês],'Calendário'[ano] = '01. Meta'[Ano]))),'Calendário'[DIaUtil])

            RETURN metaproporcional
by selecting the months from January to June in the filter this is my proposed goal:
 
3.JPG
I would like to add to this dax so that it only adds the months from January to June, without me having to filter out the 6 months in the filter.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @carolinesbp_ 

You can try the following code.

MetaProporcional =
VAR dia =
    SUMX (
        FILTER (
            'Calendário',
            'Calendário'[Data] >= '01. Meta'[Primeiro dia]
                && 'Calendário'[Data] <= '01. Meta'[Ultimo dia]
                && 'Calendário'[mês] = '01. Meta'[Mês]
                && 'Calendário'[ano] = '01. Meta'[Ano]
                && 'Calendário'[mês] >= 1
                && 'Calendário'[mês] <= 6
        ),
        'Calendário'[DIaUtil]
    )
VAR metaproporcional =
    DIVIDE ( '01. Meta'[Meta], dia )
        * SUMX (
            FILTER (
                'Calendário',
                'Calendário'[Data] >= '01. Meta'[Primeiro dia]
                    && 'Calendário'[Data]
                        <= TODAY () - 1
                    && 'Calendário'[mês] = '01. Meta'[Mês]
                    && 'Calendário'[ano] = '01. Meta'[Ano]
                    && 'Calendário'[mês] >= 1
                    && 'Calendário'[mês] <= 6
            ),
            'Calendário'[DIaUtil]
        )
RETURN
    metaproporcional

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @carolinesbp_ 

You can try the following code.

MetaProporcional =
VAR dia =
    SUMX (
        FILTER (
            'Calendário',
            'Calendário'[Data] >= '01. Meta'[Primeiro dia]
                && 'Calendário'[Data] <= '01. Meta'[Ultimo dia]
                && 'Calendário'[mês] = '01. Meta'[Mês]
                && 'Calendário'[ano] = '01. Meta'[Ano]
                && 'Calendário'[mês] >= 1
                && 'Calendário'[mês] <= 6
        ),
        'Calendário'[DIaUtil]
    )
VAR metaproporcional =
    DIVIDE ( '01. Meta'[Meta], dia )
        * SUMX (
            FILTER (
                'Calendário',
                'Calendário'[Data] >= '01. Meta'[Primeiro dia]
                    && 'Calendário'[Data]
                        <= TODAY () - 1
                    && 'Calendário'[mês] = '01. Meta'[Mês]
                    && 'Calendário'[ano] = '01. Meta'[Ano]
                    && 'Calendário'[mês] >= 1
                    && 'Calendário'[mês] <= 6
            ),
            'Calendário'[DIaUtil]
        )
RETURN
    metaproporcional

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.