The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello guys,
I have a problem that I wish to solve, if anyone could help. I tried to calculate a value of the same day, from previous month and I don't have a clue about how to do it. The comparation that I wish to show is the sales of 05-sep-2017 subtracting 05-aug-2017, in a line chart opened by day, for example. It wuold be something like this:
test = Calculate(SUM([Value]) , DATEADD([Date Event].[Day]))
-
Calculate(SUM([Value]) , DATEADD([Date Event].[Day], -1, month))
Can anybody help with a solution?
Thanks in advance
Solved! Go to Solution.
Hi @dcrios,
I created a sample table based on my assumption.
Please create measures like:
Last Month = CALCULATE ( SUM ( [Value] ), FILTER ( ALL ( 'Month-Sales' ), MONTH ( 'Month-Sales'[Date Event] ) = MONTH ( MAX ( 'Month-Sales'[Date Event] ) ) - 1 && DAY ( 'Month-Sales'[Date Event] ) = DAY ( MAX ( 'Month-Sales'[Date Event] ) ) ) ) difference = MAX('Month-Sales'[Value])-[Last Month]
Best regards,
Yuliana Gu
Hi @dcrios,
I created a sample table based on my assumption.
Please create measures like:
Last Month = CALCULATE ( SUM ( [Value] ), FILTER ( ALL ( 'Month-Sales' ), MONTH ( 'Month-Sales'[Date Event] ) = MONTH ( MAX ( 'Month-Sales'[Date Event] ) ) - 1 && DAY ( 'Month-Sales'[Date Event] ) = DAY ( MAX ( 'Month-Sales'[Date Event] ) ) ) ) difference = MAX('Month-Sales'[Value])-[Last Month]
Best regards,
Yuliana Gu
Great work, thanx it solves my pblm too, can u please explain in step by step
Hi,
Drag the date column to the visual filter and apply a criteria of October 5. Then write this calculated field formula
=CALCULATE(SUM([Value]),PREVIOUSMONTH(Calendar[Date]))
You should have a calendar table with running dates. There should be a relationship from the Date column of your source data table to the Date column of your calendar table.
@Ashish_Mathur my calendar table has future dates as we have set targets till 2019. This seems not to work .
Hi,
Please describe your question in detail. Share some data and show the expected result.
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 August 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
77 | |
71 | |
47 | |
39 |
User | Count |
---|---|
136 | |
108 | |
70 | |
64 | |
57 |