Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 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 Guys,
Can you show the dax expressions how to Calculate last 30 days, 60 Days, 90 days, 120 days. in power bi dax
Hi, @suprdata
Have you solved your problem? If it is resolved, please mark the reply that helped you as solution. If not resolved, please provide more information, such as example data and expected results.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @suprdata
I’m assuming you have a date table named 'Calendar' and a measure called [Total Sales].
Last 30 Days Example:
Last30DaysSales =
VAR LastDate = MAX('Calendar'[Date]) -- Obtém a última data visível no contexto
RETURN
CALCULATE(
[Total Sales],
FILTER(
ALL('Calendar'), -- Remove os filtros aplicados para considerar todas as datas
'Calendar'[Date] > LastDate - 30 &&
'Calendar'[Date] <= LastDate
)
)
Last 60 Days Example:
Last60DaysSales =
VAR LastDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
[Total Sales],
FILTER(
ALL('Calendar'),
'Calendar'[Date] > LastDate - 60 &&
'Calendar'[Date] <= LastDate
)
)
and so on...
Hi @suprdata
Check these videos
https://www.youtube.com/watch?v=JLupF1j49wo&t=4s
https://www.youtube.com/watch?v=RoClVB8-ql4
https://www.youtube.com/watch?v=hDopw1mPlrU
https://www.youtube.com/watch?v=5XNcGL0g-sE
I hope above videos might help you!
I hope I answered your question!
Hi @suprdata
If you want calculation like using dax for 30 60 days check these blogs.
I hope i answered your question!
it depends upon how your table is. Dax will be different if you have multiple entries in an single day. Please share sample table representing your data.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
79 | |
53 | |
39 | |
36 |
User | Count |
---|---|
100 | |
85 | |
47 | |
46 | |
44 |