Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
How to calculates one month sales (30 days back) in Power BI?
CALCULATE ( [Sales Amount], PREVIOUSMONTH ( 'Date'[Date] ) )
Is it one month sales?
It's previous month sales.
If you want to calculate last 30 days you could use (thanks to this article) :
30 Days Sales =
VAR NumOfDays = 30
VAR LastCurrentDate =
MAX ( 'Date'[Date] )
VAR Period =
DATESINPERIOD ( 'Date'[Date], LastCurrentDate, - NumOfDays, DAY )
VAR Result =
CALCULATE (
SUMX(
VALUES( Date[Date] ),
[Sales Amount]
),
Period
)
VAR FirstDateInPeriod = MINX ( Period, 'Date'[Date] )
VAR LastDateWithSales = MAX ( Sales[OrderData] )
RETURN
IF ( FirstDateInPeriod <= LastDateWithSales, Result )
How calculate the change of sales comparing with last month in euros and percentage?
Check out your's next topic. I've already answered it.
How calculate average one month sales (30 days back)?
30 Days Sales =
VAR NumOfDays = 30
VAR LastCurrentDate =
MAX ( 'Date'[Date] )
VAR Period =
DATESINPERIOD ( 'Date'[Date], LastCurrentDate, - NumOfDays, DAY )
VAR Result =
CALCULATE (
AVERAGEX(
VALUES( Date[Date] ),
[Sales Amount]
),
Period
)
VAR FirstDateInPeriod = MINX ( Period, 'Date'[Date] )
VAR LastDateWithSales = MAX ( Sales[OrderData] )
RETURN
IF ( FirstDateInPeriod <= LastDateWithSales, Result )
The syntax for '[Date]' is incorrect. (DAX( VAR NumOfDays = 30 VAR LastCurrentDate = MAX ( 'Date'[Date] ) VAR Period = DATESINPERIOD ( 'Date'[Date], LastCurrentDate, - NumOfDays, DAY ) VAR Result = CALCULATE ( AVERAGEX( VALUES( Date[Date] ), [P
Do you have separate Date table?
Yes
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
68 | |
41 | |
35 |
User | Count |
---|---|
102 | |
56 | |
52 | |
46 | |
40 |