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

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.

Reply
Anonymous
Not applicable

Multi-level aggregation using DAX

Hello,

 

I've encountered a problem when writing a DAX measure.

 

My design:
- A fact table

- A Date dimension (granularity: day)

- A Time dimension (it has Hour integers and Minute integers - only for quarters (0, 15, 30, 45)

 

What I want to achieve:

- Force Tabular to always AVERAGE my measure from 15-minute intervals to an hour.

- Force Tabular to always SUM the averages from first bullet.

- This has to work even when Time/Date dimensions aren't used in the pivot table/PBI.

 

Let's suppose this is how data at the lowest granularity looks like (there are more dimensions, though):

lowest granularity.PNG

 

This is how it should look like one level higher - no more minutes:

hourly granularity.PNG

 

This is how it should look like if we remove Time dimension:

daily granularity.PNG

 

And if I remove the Date dimension:

customer granularity.PNG

 

And If I don't use any dimensions:

highest granularity.PNG


Can anyone help me?How to achieve this in DAX?

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

You may try below measure:

Test =
SUMX (
    SUMMARIZE (
        Table1,
        Table1[Dim Customer],
        Table1[Dim Date],
        Table1[Dim Time-Hour]
    ),
    SUM ( Table1[Value] ) / COUNT ( Table1[Dim Time-Hour] )
)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
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
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

You may try below measure:

Test =
SUMX (
    SUMMARIZE (
        Table1,
        Table1[Dim Customer],
        Table1[Dim Date],
        Table1[Dim Time-Hour]
    ),
    SUM ( Table1[Value] ) / COUNT ( Table1[Dim Time-Hour] )
)

1.png

 

Regards,

Cherie

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

Hi there

What measures have you tried to do to get this working?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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.