Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I have the matrix below:
I need to create a measure that average the line Total dyamically. (I will use this measure as a line over bar chart)
For example. sum all the totals and divide by the numbers of years that I want (i.e sum from 2010 to 2015 and divide by 5 or sum the totals from 2010 to 2012 and divide by 2)
Is this possible creating some parameter?
Thank you
Solved! Go to Solution.
Hi @Anonymous ,
First create a parameter table as below,which is for dynamic selection:
Slicer table = GENERATESERIES(1,12,1)
Then create a measure as below:
Measure = IF(
NOT(ISFILTERED('Slicer table'[Value])),CALCULATE(SUM('Table'[Value])),
IF(ISINSCOPE('Table'[Country]),CALCULATE(SUM('Table'[Value])),
var _sum=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Year]>=MAX('Table'[Year])-SELECTEDVALUE('Slicer table'[Value])&&'Table'[Year]<=MAX('Table'[Year])))
Return
DIVIDE(_sum,SELECTEDVALUE('Slicer table'[Value]))))
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi @Anonymous ,
First create a parameter table as below,which is for dynamic selection:
Slicer table = GENERATESERIES(1,12,1)
Then create a measure as below:
Measure = IF(
NOT(ISFILTERED('Slicer table'[Value])),CALCULATE(SUM('Table'[Value])),
IF(ISINSCOPE('Table'[Country]),CALCULATE(SUM('Table'[Value])),
var _sum=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Year]>=MAX('Table'[Year])-SELECTEDVALUE('Slicer table'[Value])&&'Table'[Year]<=MAX('Table'[Year])))
Return
DIVIDE(_sum,SELECTEDVALUE('Slicer table'[Value]))))
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
@Anonymous , Try a measure like
AverageX(summarize(Table, Table[City], Table[Year], "_1",[measure]) ,[measure])
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
42 | |
31 | |
27 | |
27 |