Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have summary sales data table called Sales
I want to create a line chart with one line being the sales each month for 2024 and another one being the sales for same month last year.
I have a date table related to [Sales]MonthEnding
All the examples I'm finding for doing this are doing a CALCULATE on a total sales measure which calculates the total sales from individual sales lines, but I don't have sales lines to sum up for a measure.
What do I need to do?
Solved! Go to Solution.
@jlanigan Try:
Measure =
VAR __Date = MAX('Sales'[MonthEnding])
VAR __PYDate = EOMONTH( __Date, -12 )
VAR __Table = FILTER( ALL('Sales'), [MonthEnding] = __PYDate )
VAR __Result = SUMX( __Table, [Sales] )
RETURN
__Result
Thanks Greg.
I really need to get my head around measures. I can put together a decent report but i'm doing it all with filters and some calculated columns, almost zero measures.
@jlanigan Try my DAX For Humans YouTube channel: DAX for Humans - YouTube
@jlanigan Try:
Measure =
VAR __Date = MAX('Sales'[MonthEnding])
VAR __PYDate = EOMONTH( __Date, -12 )
VAR __Table = FILTER( ALL('Sales'), [MonthEnding] = __PYDate )
VAR __Result = SUMX( __Table, [Sales] )
RETURN
__Result