The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello Team,
I am trying to calculate sales for the last 30 days using the below formula but it does not seem to be working:
Hi @Hasvine2022
Please refer to this similar thread Solved: Calculate Sales Past 30 Days - Microsoft Power BI Community
If possible, can you please show the relationship between Sales and Calendar tables? Inappropriate relationship may cause different results.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi,
I think this thread could help you: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Show-30-days-data-in-visual-before-the-date-s...
New Measure = VAR __date_selected = MAX ( 'Calendar'[Date] ) // assuming there exists a calendar table in your model, and Calendar[Date] is sliced VAR __period = DATESINPERIOD ( 'Calendar'[Date], __date_selected, -30, DAY ) VAR __inbetween = CALCULATE ( MAX ( factTable[Date] ), ALL ( 'Calendar'[Date] ) ) IN __period // slcier must be removed in order to keep all other dates in sight RETURN IF ( __inbetween, [Old Measure] )
Hi,
Thank you for your help. It does not seem to work. 😞
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
248 | |
124 | |
111 | |
78 | |
78 |