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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Filter contex problem

Hi, I have a measure that calculates the average expense per month per selected period.

 

I would like to avoid being filtered by other time slicers on the page. 

 

My goal is to have a bar chart with the X showing expense categories, Y showing the amount and as input value:

1. the total expense for the selected period according to the slicer (here I will select a specific year and specific month)

2. My measure returning what is the average expense per month for the selected period (here I want to return the average expense per month for the select year)

 

I hope that I have explained myself. Currently, if I add both measures to the graph I am getting the same values because my measure is calculating the average of the selected month which ofc is the same as the total of the month.

 

Thank you for the help!

 

below the code of my measure and an image to explain my goal:

SimoneXasto_0-1697388012085.png

 

 

WA Monthly = 
VAR AnnualAmount =
    CALCULATE(
        [Net Amount TOT],
        ALL(
            DateTable[Date])
    )
VAR MonthlyTable =
    ADDCOLUMNS(
        SUMMARIZE(
            Merged_Final,
            DateTable[Year],DateTable[Month]
        ),
        "MonthlySales",[Net Amount TOT],
        "Wt",[Net Amount TOT]/AnnualAmount
    )
VAR WA_Monthly =
    SUMX(
        MonthlyTable,
        [Wt]*[MonthlySales]
    )
RETURN
ABS(WA_Monthly)

 

 

1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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