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
ovinasca
Frequent Visitor

Measure aggregated based on dimensions

Hi all!

 

I need to create a measure that aggregates based on dimensions, I mean, when its aggregated by the Time Dimension I need to SUM the values but when its aggregated by the Department Dimension I need to AVERAGE the values.

 

Thanks in advanced.

Regardsfte_ex.jpg

1 ACCEPTED SOLUTION

@ovinasca

 

Hi, try with this Measure in Values Section

 

Measure =
IF (
    HASONEVALUE ( Table1[TIME] );
    SUM ( Table1[FTE's] );
    AVERAGE ( Table1[FTE's] )
)

Regards

 

Victor

Lima - Peru

 

 

 




Lima - Peru

View solution in original post

16 REPLIES 16
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @ovinasca,

 

Can you share a sample please? In other words, can we take the non-total values as the original data?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yes it is!

 

The non total values are the original data and the total values should be the aggregation output depending on the dimension. 

 

The picture shows what would be the final result

 

Thanks!!!

 

 

Greg_Deckler
Community Champion
Community Champion

So, does that represent source data, expected output, neither, both?

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Sorry and thanks for the post you suggested!!!

 

The pìcture shows what should be the final result. We have a measure called FTE's with two dimensions, WEEK and DEPARTMENT.

 

I want the values of FTE's to be aggregated as SUM when working with WEEK (Time) Dimension and I want them to be aggregated as AVERAGE when working with DEPARTMENT Dimension.

 

Hope if helps.

 

Thanks!!

Regards

@Greg_Deckler

@v-jiascu-msft

 

Sorry I forgot both mentions.

 

THANKS!!!

@ovinasca- What would be very helpful is if you could share the source data that results in the totals that you shared.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

 

 

OK, so what would that look like if it was aggregated by the "time dimension"?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

That's TOTAL(2) in the picture, and if you aggregate by department dimension you whould obtain TOTAL (1)

Hope it helps.... 

 

Maybe it's not possible....

 

Thanks!fte_ex2.jpg

Is there a reason why you cannot just have 2 measures, one for SUM and one for AVERAGE?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Well, I could try to use a work-around presentation for the data.

 

But anyway, using two different measures I will have the same problem working with matrix:

 

 

fte_ex3.jpg

 

 

The red cells are wrong.....

 

 

@ovinasca

 

Hi, try with this Measure in Values Section

 

Measure =
IF (
    HASONEVALUE ( Table1[TIME] );
    SUM ( Table1[FTE's] );
    AVERAGE ( Table1[FTE's] )
)

Regards

 

Victor

Lima - Peru

 

 

 




Lima - Peru
Anonymous
Not applicable

Solution is great and solves the initial problem. But can you help on the Total Sum cell as well? Current solution calculates the AVERAGE on the full table which returns 5 which doesn't make much sense. What is the solution to make the AVERAGE of total SUMs instead of AVERAGE of whole table at lowest level? The correct result should be 15

Thanks @Vvelarde I will try tomorrow, I think i will work for that specific example, but if I have other dimension?

 

fte_ex4.jpg

 

Not sure....

 

I will tell you !!!!

 

THANKS!

Hi @Vvelarde!! 

 

Works only for the suggested example, I mean, working only with two dimensions but works for me!

 

So thanks!!

 

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.