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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.