This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I am trying to combine 2 calcluated measures into one calculated measure, but the resulting answer is incorrect. Please help me understand what is wrong or how do I go about creating a measure that would give the the correct result.
Sample .pbix file
Date Table:
Date | WeekNum | Week |
7/8/24 | 2 | 28 |
7/9/24 | 3 | 28 |
7/10/24 | 4 | 28 |
. | . | . |
. | . | . |
. | . | . |
7/10/23 | 2 | 28 |
7/11/23 | 3 | 28 |
7/12/23 | 4 | 28 |
. | . | . |
Measure 1:
_SDLY Net Sales =
VAR CurrentDayOfWeek = MAX('Date'[WeekNum])
VAR CurrentWeek = MAX('Date'[Week])
VAR LastYear = MAX('Date'[Year]) - 1
RETURN
CALCULATE(
[Net Sales]
, ALL('Date')
, 'Date'[Week] = CurrentWeek
, 'Date'[Day of Week Number] = CurrentDayOfWeek
, 'Date'[Year] = LastYear
)
Measure 2:
SDLY Net Sales = SUMX ( 'Date', [_SDLY Net Sales] )
Test SDLY =
VAR CurrentDayOfWeek = MAX('Date'[Day of Week Number])
VAR CurrentWeek = MAX('Date'[Week])
VAR LastYear = MAX('Date'[Year]) - 1
VAR Result =
CALCULATE(
[Net Sales],
ALL('Date'),
'Date'[Week] = CurrentWeek,
'Date'[Day of Week Number] = CurrentDayOfWeek,
'Date'[Year] = LastYear
)
RETURN
SUMX('Date', Result)
Resulting Table:
Hi @crispy_sam
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Added a link to .pbix file in main post.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 39 | |
| 28 | |
| 28 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 37 | |
| 32 | |
| 27 | |
| 25 |