Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello
i would like to create a measure that do the following:
MEASURE = (MONTH) - (LASTMONTH)
The idea is to use the variance to make a waterfall chart showing 2 years (24 months)
Solved! Go to Solution.
You can try with PREVIOUSMONTH function as smoupre said. Just give a simple sample as below. Assuming we have a sales table from 1/1/2014 to one day in 2017.
We can create a Calendar table firstly with following DAX formula. Create relationship with the sales table with date key. Put this Calendar[Date] column into the Slicer visual.
Calendar = CALENDAR ( "1/1/2014", "12/31/2017" )
Create a PreMonthSales and a Diff measure. Drag them into the Waterfall chart.
PreMonthSales = CALCULATE ( SUM ( Table1[Sales] ), PREVIOUSMONTH ( Table1[Date] ) )
MEASURE = CALCULATE ( SUM ( Table1[Sales] ) - [PreMonthSales] )
I've also uploaded the PBIX file here for reference.
Best Regards,
Herbert
You can try with PREVIOUSMONTH function as smoupre said. Just give a simple sample as below. Assuming we have a sales table from 1/1/2014 to one day in 2017.
We can create a Calendar table firstly with following DAX formula. Create relationship with the sales table with date key. Put this Calendar[Date] column into the Slicer visual.
Calendar = CALENDAR ( "1/1/2014", "12/31/2017" )
Create a PreMonthSales and a Diff measure. Drag them into the Waterfall chart.
PreMonthSales = CALCULATE ( SUM ( Table1[Sales] ), PREVIOUSMONTH ( Table1[Date] ) )
MEASURE = CALCULATE ( SUM ( Table1[Sales] ) - [PreMonthSales] )
I've also uploaded the PBIX file here for reference.
Best Regards,
Herbert
Thks herbert, that was just what i needed :).
Sounds like you need the PREVIOUSMONTH function:
https://msdn.microsoft.com/en-us/library/ee634758.aspx
Can't really say much more without sample data.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
69 | |
66 | |
51 | |
33 |
User | Count |
---|---|
114 | |
97 | |
75 | |
65 | |
39 |