Join 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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi All,
I'm currently working with a datamodel that was created by our BI partner.
This model has a measure called "Margin" that calculates the margin on orders/products etc.. based on relations in the datamodel.
I want to make a measure that gets the average margin in a period. For example I have a page where I can select a week and it will show information about that week.
The "AVERAGE" function in PBI needs to refer to a table which I don't have. Is it possible to still get the average margin or is this not possible in PBI?
Measure would look something like this:
Avg_Margin = AVERAGE(Margin)
Thanks in advance!
Solved! Go to Solution.
HI @Yvalson,
How did these two table relationship mapping? Can you please share some more detail infoatmaiosn about these? They will help us clarify your caeiro and test to coding formulas.
How to Get Your Question Answered Quickly
BTW, measure expression cannot directly aggregate with other functions. You can create a variable table with this formula to stay the specific result based on current category group.
Then you can use iterator aggregate function to apply the second level aggregation on it.
formula =
VAR selection =
ALLSELECTED ( Calendar[Date] )
VAR summary =
SUMMARIZE (
FILTER ( ALLSELECTED ( Table1 ), [Date] IN selection ),
[Date],
"cMargin", [Margin]
)
RETURN
AVERAGEX ( summary, [cMargin] )
Regards,
Xiaoxin Sheng
HI @Yvalson,
How did these two table relationship mapping? Can you please share some more detail infoatmaiosn about these? They will help us clarify your caeiro and test to coding formulas.
How to Get Your Question Answered Quickly
BTW, measure expression cannot directly aggregate with other functions. You can create a variable table with this formula to stay the specific result based on current category group.
Then you can use iterator aggregate function to apply the second level aggregation on it.
formula =
VAR selection =
ALLSELECTED ( Calendar[Date] )
VAR summary =
SUMMARIZE (
FILTER ( ALLSELECTED ( Table1 ), [Date] IN selection ),
[Date],
"cMargin", [Margin]
)
RETURN
AVERAGEX ( summary, [cMargin] )
Regards,
Xiaoxin Sheng
User | Count |
---|---|
98 | |
75 | |
69 | |
49 | |
26 |