Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
547 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Changes in the February 2023 Power BI Update Part seven of an eight-part series of blogs |
---|
There are quite a few changes in this month's update, but none of them will change your life that much!
We've been creating our idiosyncratic monthly blogs on Power BI updates since November 2016, and also deliver online and classroom Power BI courses. |
For all you fans of least-squares linear regression out there - two new DAX functions!
Power BI already gives you the ability to show trendlines:
A trendline showing how sales broadly speaking go up in line with shop unit sizes for the different towns in the Wise Owl Create-a-Creature database.
As a reminder, here's how you add a trendline to a chart like this:
You can use the analytics tab to add trendlines like this to charts.
Suppose that you have a table giving the sales and number of units for each town:
The sales and number of shop units for each town in the Create a Creature database.
You can now create a measure to give the intercept of a regression line based on this data:
RegressionIntercept =
// get two columns of data for analysis
VAR RegressionStats =
LINEST(
Town[Sales],
Town[Units]
)
// the LINEST function returns a single row table with
// a number of columms - the main ones we will normally
// be interested in are the intercept and the slope
RETURN MAXX(
RegressionStats,
[Intercept]
)
You can create an almost-identical measure to get the slope of the regression line:
RegressionIntercept =
// get two columns of data for analysis
VAR RegressionStats =
LINEST(
Town[Sales],
Town[Units]
)
// the LINEST function returns a single row table with
// a number of columms - the main ones we will normally
// be interested in are the intercept and the slope
RETURN MAXX(
RegressionStats,
[Slope1]
)
Below I've then displayed the results from these two measures on cards:
So the equation of the regression line for this data should be y = 25.37 x - 42.79.
The LINESTX function works in a similar way, but like any other expression function asks for a table as its first argument.
The main problem with these new functions is knowing what the created columns are called:
The Intercept and Slope1 names don't appear in Intellisense, and the red wavy underline suggests that they're wrong!
You can see the available columns that you can reference for the LINEST function here and for LINESTX here.
Parts of this blog |
---|
|
Some other pages relevant to the above blogs include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.