Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Help me please! Now the month is March, I want to display the dynamics of sales, there were no sales this month, they were in February. the CALCULATE(SUM('Свод221'[Количество изделий всего,шт]),DATESMTD('Свод221'[Датавыдачи])) function displays the last month of the sale, not the current March, how do I display March and that the sales are 0? Or can you tell me right away how to compare the current month with the previous one?
Solved! Go to Solution.
@DeEviloN , Ti using today
MTD=
var _max = if(day(today() )=1 , eomonth(today(),-1), today())
var _min = eomonth(_max,-1)+1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )
LMTD =
var _max1 = if(day(today() )=1 , eomonth(today(),-1), today())
var _max = date(year(_max1),month(_max1)-1, day(_max1))
var _min = eomonth(today(),-2)+1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )
This month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
@DeEviloN , Ti using today
MTD=
var _max = if(day(today() )=1 , eomonth(today(),-1), today())
var _min = eomonth(_max,-1)+1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )
LMTD =
var _max1 = if(day(today() )=1 , eomonth(today(),-1), today())
var _max = date(year(_max1),month(_max1)-1, day(_max1))
var _min = eomonth(today(),-2)+1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )
This month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Look what's wrong with the previous month
Hi, @DeEviloN
It's hard to figure out the problem from the screenshot, can you share more details for research?
Best Regards,
Community Support Team _ Eason
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
108 | |
108 | |
93 | |
61 |
User | Count |
---|---|
169 | |
138 | |
135 | |
102 | |
86 |