Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi Everyone,
I am have created a measure to calculate sums over different time periods using:
768,109 is the correct value, but I am not sure why adding a row pulls in a ton of data that doesn't belong. Somehow 1,878,798 is being pulled. There are many questions about the total being incorrect, but I haven't been able to find the inverse and it seems odd.
Thanks for any help!
Solved! Go to Solution.
Hi,
Try this.
Sales Last 4 Weeks = CALCULATE( SUM( 'Invoice Data'[Amount] ), datesbetween( 'calendar'[date],min('calendar'[date])-28,min('calendar'[date])))
This measure will give you the wrong result in the Total row. Therefore, drag this measure below to the vissual
Measure = SUMX(VALUES('Calendar'[Date]),[Sales last 4 weeks])
If these measures do not work, then share the download link of the PBI file. Show the problem there and the expected result.
Thanks for the reply from @Ashish_Mathur , please allow me to provide another insight:
Hi @PizzaJim ,
Try to modify your formula like below:
Sales Last 4 Weeks =
VAR __MaxDate = MAX('Invoice Data'[Date])
VAR __StartDate = __MaxDate - 28
RETURN
CALCULATE(
SUM('Invoice Data'[Amount]),
FILTER(
ALL('Invoice Data'),
'Invoice Data'[Date] <= __MaxDate &&
'Invoice Data'[Date] > __StartDate
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from @Ashish_Mathur , please allow me to provide another insight:
Hi @PizzaJim ,
Try to modify your formula like below:
Sales Last 4 Weeks =
VAR __MaxDate = MAX('Invoice Data'[Date])
VAR __StartDate = __MaxDate - 28
RETURN
CALCULATE(
SUM('Invoice Data'[Amount]),
FILTER(
ALL('Invoice Data'),
'Invoice Data'[Date] <= __MaxDate &&
'Invoice Data'[Date] > __StartDate
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Try this.
Sales Last 4 Weeks = CALCULATE( SUM( 'Invoice Data'[Amount] ), datesbetween( 'calendar'[date],min('calendar'[date])-28,min('calendar'[date])))
This measure will give you the wrong result in the Total row. Therefore, drag this measure below to the vissual
Measure = SUMX(VALUES('Calendar'[Date]),[Sales last 4 weeks])
If these measures do not work, then share the download link of the PBI file. Show the problem there and the expected result.
User | Count |
---|---|
118 | |
66 | |
65 | |
56 | |
50 |
User | Count |
---|---|
182 | |
85 | |
67 | |
61 | |
53 |