Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
aletho
Helper I
Helper I

Comparing turnover in curved line chart

Hi all

Hope you're enjoying your weekend.  

 

I am trying to make a graph like the one below with similar data as below the graph. The data I am working with is running live from my SQL server, so I made the example below to visualize what I want to do in Power Bi.

 

I have different data running over the last ten years, from financial numbers to everything you find it google analytics. 

What I would find very useful is having graphs like the one I made in Excel, where I can select different years to easily compare specific months over time.

 

Any answers are appreciated

thanks 🙂   

 

 

Udklip.PNG

dateturnover
01-01-2016105
02-01-2016102
03-01-2016104,4
04-01-2016105
05-01-2016105
06-01-2016106
07-01-2016112
08-01-2016140,5
09-01-2016150
10-01-2016152
11-01-2016153
12-01-2016140
01-02-2017126
02-02-2017122,4
03-02-2017125,28
04-02-2017126
05-02-2017126
06-02-2017127,2
07-02-2017134,4
08-02-2017168,6
09-02-2017180
10-02-2017182,4
11-02-2017183,6
12-02-2017168
01-01-2018163,8
02-01-2018159,12
03-01-2018162,864
04-01-2018163,8
05-01-2018163,8
06-01-2018165,36
07-01-2018174,72

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

I created the following chart

image.png

adding some stuff to the table you provided.

 

Here you will find the PBIX file

 

I did the following I created a separate date table using this simple DAX statement, a separate date table is always a good idea not to say a best practice:

Calendar = 
ADDCOLUMNS(
    CALENDAR("2016-01-01", "2018-07-31")
    ,"Month Name", FORMAT(''[Date], "MMM")
    ,"Month No", MONTH(''[Date])
    ,"Year", YEAR(''[Date])
)

I used the column "Month No" to order the column "Month Name"

In the "Data" view select "Sort by Column" from the "Modeling" menu

image.png

 

And I also created a relationship between the calendar tabel (one side) and the fact tabel (many side) - that's it 🙂

 

Regarding the information "running live from my SQL Server" I guess you mean the connection is either "Direct Query" (the data is coming from the relational engine" or "Live Connection" if the data is hosted in SQL Server Analysis Services.

 

The solution I described above is relying on the existence of a calendar table, this table currently can just be created in Power BI if the data is imported, this will change as soon as the preview feature "Composite Model" will become generally available.

 

So eihter you import the data (then you have to consider how often the data needs to be refreshed) or ask the people that are owning the SQL Server data to create a Calendar table inside the SQL Server database,

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

I created the following chart

image.png

adding some stuff to the table you provided.

 

Here you will find the PBIX file

 

I did the following I created a separate date table using this simple DAX statement, a separate date table is always a good idea not to say a best practice:

Calendar = 
ADDCOLUMNS(
    CALENDAR("2016-01-01", "2018-07-31")
    ,"Month Name", FORMAT(''[Date], "MMM")
    ,"Month No", MONTH(''[Date])
    ,"Year", YEAR(''[Date])
)

I used the column "Month No" to order the column "Month Name"

In the "Data" view select "Sort by Column" from the "Modeling" menu

image.png

 

And I also created a relationship between the calendar tabel (one side) and the fact tabel (many side) - that's it 🙂

 

Regarding the information "running live from my SQL Server" I guess you mean the connection is either "Direct Query" (the data is coming from the relational engine" or "Live Connection" if the data is hosted in SQL Server Analysis Services.

 

The solution I described above is relying on the existence of a calendar table, this table currently can just be created in Power BI if the data is imported, this will change as soon as the preview feature "Composite Model" will become generally available.

 

So eihter you import the data (then you have to consider how often the data needs to be refreshed) or ask the people that are owning the SQL Server data to create a Calendar table inside the SQL Server database,

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thanks, Tom! This is really helpful 🙂 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.