Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I'm fairly new to Power BI.
I have a simple matrix table which has types of service on the rows, months as columns and the some of each as the values, as follows:
| Service | Jan | Feb | Mar |
| Service 1 | 500 | 800 | 300 |
| Service 2 | 600 | 900 | 400 |
| Service 3 | 700 | 1,000 | 500 |
What I want to be able to to do is convert that so I can see the variance from the previous month i.e. Service 1 from Jan to Feb would be a positive variance of 300 and so on.
I've tried all sorts but nothing seems to work.
Any advice would be much appreciated.
Thanks
Colin
I fixed that...
It is now only showing one column with variances I don't recognise... 😞
Regards
Colin
That makes sense...
I'm getting the following error when I add that measure?
OrderBy column 'Month No.' could not be found in OFFSET's Relation parameter.
Regards
Colin
Hi,
I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.
expected result measure: =
VAR _currentvalue =
SUM ( Data[Value] )
VAR _prevmonthvalue =
CALCULATE (
SUM ( Data[Value] ),
OFFSET ( -1, ALL ( 'Month' ), ORDERBY ( 'Month'[Month No], ASC ) )
)
RETURN
IF (
NOT ISBLANK ( _prevmonthvalue ) && HASONEVALUE ( Service[Service] ),
_currentvalue - _prevmonthvalue
)
Thanks for this, i will give it ago.
I haven't got a data model as you sugest, all of my data work is done in the transform section then i'm using the final appended and merged data as my source data.
Why do we need a month number, I assume I need to add this to my data?
Regards
Colin
Hi,
Thank you for your message.
The reason why we need a month number column is that,
- Jan, Feb, and Mar has to be sorted by month number column, not by alphabetical order.
- we need to let Power BI know that "Feb" minus one is "Jan".
The month number column helps these kinds of sort-order-arrangement and calculations.
I hope this helps.
Thanks.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 65 | |
| 39 | |
| 33 | |
| 23 |