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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
gco
Resolver II
Resolver II

Help with filters

Hi there,

 

I have a report that has been working last year, and this year it broke because of our 2020 data.  Can you please help me figure out what filter to use to be able to display the correct value?

 

I am calculating %ToGoalYTD (% of current month compared to year-end goal).  Since i have YTD goal for both 2019 and 2020, the filter below combines the YearEnd for 2019 and 2020, instead of just for the year 2019, if i set my slicer to use 2019.  I think i need to replace ENDOFYEAR(Variance[MonthEndDate]) with something else.

 

I wanted the yearend value to be of 2019 if i set my slicer to 2019.  And same with 2020.

 

%ToGoalYTD = DIVIDE(SUM(Goal[Balance]),CALCULATE( SUM (Goal[Value]), FILTER (ALL (Variance), Variance[MonthEndDate] = ENDOFYEAR (Variance[MonthEndDate])), VALUES (Variance[BranchName])),0)
 
Thank you
Glen
1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @gco ,

 

Could you please try to change the ALL to ALLSELECT Function?  If it does not work, could you please also provide the mockup Variance table based on fake data?

 

%ToGoalYTD =
DIVIDE (
    SUM ( Goal[Balance] ),
    CALCULATE (
        SUM ( Goal[Value] ),
        FILTER (
            ALLSELECTED ( Variance ),
            Variance[MonthEndDate] = ENDOFYEAR ( Variance[MonthEndDate] )
        ),
        VALUES ( Variance[BranchName] )
    ),
    0
)


Best regards,

 

Community Support Team _ Dong Li
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

3 REPLIES 3
gco
Resolver II
Resolver II

BranchNameMonthEndDateBalanceValue
Branch11/31/2019500600
Branch112/31/2019750800
Branch11/31/2020 700
Branch112/31/2020 800
Branch21/31/2019400700
Branch212/31/2019600800
Branch21/31/2020 900
Branch212/31/2020 1000

Here is a sample table.  

 

%ToGoalYTD (Jan 2019) should be = DIVIDE(500/800).  With the measure i was using, it is coming up as DIVIDE(500/1600).  The YEAREND is combining 12/31/2019 and 12/31/2020 for some reason.

 

Thank you

Glen

 

v-lid-msft
Community Support
Community Support

Hi @gco ,

 

Could you please try to change the ALL to ALLSELECT Function?  If it does not work, could you please also provide the mockup Variance table based on fake data?

 

%ToGoalYTD =
DIVIDE (
    SUM ( Goal[Balance] ),
    CALCULATE (
        SUM ( Goal[Value] ),
        FILTER (
            ALLSELECTED ( Variance ),
            Variance[MonthEndDate] = ENDOFYEAR ( Variance[MonthEndDate] )
        ),
        VALUES ( Variance[BranchName] )
    ),
    0
)


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-lid-msft ,

 

Your solution was spot on!!!  I went and changed my measure from ALL to ALLSELECTED and it shows the correct calculations now.  Thank you again for your expertise and for your help on resolving my issue.  I owe you big time.

 

Thank you again

Glen

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors