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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.