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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

DAX function remove filter

Hi All! Hope doing well,

 

I have an issue in one personal project im working on.

I have a table called Costs which contains period, brand,team code,country, and values. Then i have another one called Team which contains info about the teams such as employee name, country, brand, team code, region,etc.

 

Im creating a table that have country, employee name, office, brand, and one measure as columns, now i need another measure that calculates costs over the past 3 months for the brand that the employee is working now, lets say one row is employee A, brand XY, country B, i need a measure to calculate the XY total costs, and another one to calculate XY costs for country B. Is it possible?

 

Let me know if anything missing.

 

Thanks!

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Anonymous , You can try using measures

 

TotalCostsBrand3Months =
VAR CurrentBrand = SELECTEDVALUE(Team[brand])
VAR CurrentDate = MAX(Costs[period])
RETURN
CALCULATE(
SUM(Costs[values]),
Costs[brand] = CurrentBrand,
Costs[period] >= EDATE(CurrentDate, -3)
)

 


TotalCostsBrandCountry3Months =
VAR CurrentBrand = SELECTEDVALUE(Team[brand])
VAR CurrentCountry = SELECTEDVALUE(Team[country])
VAR CurrentDate = MAX(Costs[period])
RETURN
CALCULATE(
SUM(Costs[values]),
Costs[brand] = CurrentBrand,
Costs[country] = CurrentCountry,
Costs[period] >= EDATE(CurrentDate, -3)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@Anonymous , You can try using measures

 

TotalCostsBrand3Months =
VAR CurrentBrand = SELECTEDVALUE(Team[brand])
VAR CurrentDate = MAX(Costs[period])
RETURN
CALCULATE(
SUM(Costs[values]),
Costs[brand] = CurrentBrand,
Costs[period] >= EDATE(CurrentDate, -3)
)

 


TotalCostsBrandCountry3Months =
VAR CurrentBrand = SELECTEDVALUE(Team[brand])
VAR CurrentCountry = SELECTEDVALUE(Team[country])
VAR CurrentDate = MAX(Costs[period])
RETURN
CALCULATE(
SUM(Costs[values]),
Costs[brand] = CurrentBrand,
Costs[country] = CurrentCountry,
Costs[period] >= EDATE(CurrentDate, -3)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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