This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi all,
I'm having a bit of a trouble with creating some measures correctly.
I want to have a bar-chart visualization of change in percentage for current month vs. previous month.
In the data I've created some sample data which has values in the months between january 2019 to november 2019 (no data for december 2019). However, the previous month measure calculates the november 2019 value and uses this so that in the bar chart I get a -100% change since previous month for december 2019.
Anyone know a way to sort this, so that I only calculate previous months where I have data for current month?
Here is some screenshots of current state:
The measures I got at the moment is:
Total Value = SUM ( FACT_Test[SampleData] )
Previous Month = CALCULATE ( [Total Value] ; PREVIOUSMONTH (DIM_Date[Date] ))
% Change = DIVIDE ( [Total Value] ; [Previous Month] ; BLANK() ) -1
Thanks 🙂
Solved! Go to Solution.
Hi @Anonymous
I edited your measures with adding IF function, please kindly check whether it works for you:
Previous Month = IF(ISBLANK([Total MonthlyMockUp]),BLANK(),CALCULATE( [Total MonthlyMockUp] , PREVIOUSMONTH( 'Date'[Date] )))
% change = IF(ISBLANK([Previous Month]),BLANK(),DIVIDE( [Total MonthlyMockUp] , [Previous Month] , BLANK() ) - 1)
Pbix attached,
Hi @Anonymous
You might consider creating pbix file that will contain some sample data, upload the pbix to onedrive or dropbox and share the link to the file. Please do not forget to describe the expected results based on this sample data.
I'd like to draw it up for you.
Hi @v-diye-msft,
Thanks for your reply.
Here is the link for the .pbix:
https://1drv.ms/u/s!AnO2QNNGszZMjWorRLvE2Zqriy4y?e=oA6AFb
Hi @Anonymous
I edited your measures with adding IF function, please kindly check whether it works for you:
Previous Month = IF(ISBLANK([Total MonthlyMockUp]),BLANK(),CALCULATE( [Total MonthlyMockUp] , PREVIOUSMONTH( 'Date'[Date] )))
% change = IF(ISBLANK([Previous Month]),BLANK(),DIVIDE( [Total MonthlyMockUp] , [Previous Month] , BLANK() ) - 1)
Pbix attached,
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 25 | |
| 21 | |
| 18 | |
| 17 |
| User | Count |
|---|---|
| 62 | |
| 34 | |
| 33 | |
| 25 | |
| 24 |