Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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):
This is how it should look like one level higher - no more minutes:
This is how it should look like if we remove Time dimension:
And if I remove the Date dimension:
And If I don't use any dimensions:
Can anyone help me?How to achieve this in DAX?
Thanks in advance.
Solved! Go to Solution.
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] )
)
Regards,
Cherie
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] )
)
Regards,
Cherie
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 39 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |