0845 643 64 63

Monthly Archives: August 2021

How to create the Fibonacci Sequence in Python

This blog post will go through how to create the famous Fibonacci sequence in Python.

Each number in the Fibonacci sequence is the sum of the previous two terms.

The sequence starts: 0, 1, 1, 2, 3, 5, 8, 13, … and carries on infinitely.

The Python code I used is:

The first two terms are entered into our list, then we specify the number of terms wanted in our sequence.

Next, we loop through from 2 to the number of terms we wanted appending the sum of the previous two terms.

Printing our list gives the first fifty terms of the Fibonacci sequence.

How to change the summarization of multiple columns in Power BI.

Have you ever been faced with the issue where Power BI automatically adds a sigma symbol to the front of your column if it detects it’s a data type of integer or decimal?

Now this isn’t too much of an issue if you’ve imported only a few columns but what if you’ve imported lots? Going through this column by column can become tiresome!

Luckily there is a hack, not only to turn summarization to “None” on multiple columns at once, but also to quickly change the formatting too.

As an example, I have imported a table from Excel into Power BI with 27 columns (“Column A” through to “Column Z”) and a “Key” column. Power BI detected that all of my columns contain whole numbers (or integers) and applied a summarization of “sum” against each column automatically.

So how do we quickly change this? Click the “Model” tab on the left hand side. Open the table up to expose all the columns within a table you want to change multiple columns within. Next select the inital column you want to change and then either select a range of fields using Shift+Click or select multipile fields using Control+Click.

“Shift + Click”
“Control + Click”

Once you’ve selected the group of columns you want to change find the advanced drop down in the properties window and change the “Summarize by” option to “None”.

That’s it! There are other formatting properties in here too so feel free to have a play and change multiple columns at once!

Power BI Sentinel
The Frog Blog

Team Purple Frog specialise in designing and implementing Microsoft Data Analytics solutions, including Data Warehouses, Cubes, SQL Server, SSIS, ADF, SSAS, Power BI, MDX, DAX, Machine Learning and more.

This is a collection of thoughts, ramblings and ideas that we think would be useful to share.

Authors:

Alex Whittles
(MVP)
Reiss McSporran
Jeet Kainth
Jon Fletcher
Nick Edwards
Joe Billingham
Microsoft Gold Partner

Data Platform MVP

Power BI Sentinel
Frog Blog Out
twitter
rssicon