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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
lakshay12311
Regular Visitor

Calculated measure excluding slicer

Hello all,

 

I have a scenario where I have 3 tables – 1 fact( named Actual) and 2 dimensions( Calendar and Account Dim). These are connected via Account ID and Date ID.

I have a required to create 2 measure :

  1. Total 3 months moving Avg for Account Cat= CALCULATE('Actual'[3Mnths Moving Avg],Account[Account Desc]="Cat")
  2. Value on Hand= DIVIDE(SUM('Actual'[Value]), Actual[Total 3 months moving Avg for Account Cat])

 

I want to get below table values. I am unable to get these. Can someone please suggest on what DAX needs to be changed?

 

 

Total 3 months moving Avg for Account Cat

Value

Value on Hand

Apple

1800

300

0.166666667

Boy

1800

400

0.222222222

Cat

1800

600

0.333333333

 

 

Sample data for Actual is :

 

Date ID

Account ID

Value

3Mnths Moving Avg

1

A

100

500

1

A

200

600

1

B

300

700

1

B

100

500

1

C

100

600

1

C

200

700

1

C

300

500

 

Sample data for Account Dim:

Account ID

Account Desc

A

Apple

B

Boy

C

Cat

 

 

 

Thanks,

Lakshay

 

1 REPLY 1
AnkitKukreja
Super User
Super User

Hi @lakshay12311 

Try something like this

 

CALCULATE ( AVERAGEX ( VALUES ( 'Date'[YearMonth] ), [Sales] ), DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -3, MONTH ) )

 

Thanks,

Ankit

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Solution Authors