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

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

Reply
Anonymous
Not applicable

Average of last 6 months data in cards

Hi All ,

 

I am getting error message below when i am using Averagex DAX for my scenario.

I want to get the average values in card visual from the last 6 months data in line chart.

Below the error message and the data visuals (the one with title of Project Code Creations)

 

dinesharivalaga_0-1711689299511.png

Please help to fix this issue for me 😞 

Good Friday .. TIA 🙂

 

TR

Dinesh

 

2 ACCEPTED SOLUTIONS
Dangar332
Super User
Super User

hi, @Anonymous 

in your datesinperiod update like below

 

=
datesinperiod(
    'PA-GLOBAL LANDING PAGE'[MONTH],
     MAX('PA-GLOBAL LANDING PAGE'[MONTH]),
     -6,
     MONTH
)

 

 

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

isha_7
Regular Visitor

Hello @Anonymous ,

 

If you want to get the average values in card visual, use AVERAGE instead of AVERAGEX.

 

Here is the code for that.

isha_7_0-1711692023413.png

Replace 'financial[Sales Price]' with '[Total project code creation]' 

       and 'financial[Date]' with '[Your date column].

 

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

2 REPLIES 2
isha_7
Regular Visitor

Hello @Anonymous ,

 

If you want to get the average values in card visual, use AVERAGE instead of AVERAGEX.

 

Here is the code for that.

isha_7_0-1711692023413.png

Replace 'financial[Sales Price]' with '[Total project code creation]' 

       and 'financial[Date]' with '[Your date column].

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Dangar332
Super User
Super User

hi, @Anonymous 

in your datesinperiod update like below

 

=
datesinperiod(
    'PA-GLOBAL LANDING PAGE'[MONTH],
     MAX('PA-GLOBAL LANDING PAGE'[MONTH]),
     -6,
     MONTH
)

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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