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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
K_Hermann
Regular Visitor

Months in wrong order

dashbaord.PNG

Hello, I need help with a subject.

I have a few KPI's which are numbers, a target which is a number and the months.

If I make a cauge I can select the current month, july. But if I make a KPI visualisation or table/graph to compare the data of this current months with the months before I get the months in the wrong order. It compares june with july and august instead of august with july and june. In the graphs the numbers also start with june (0,2), not august (1,0). And in the table they start with the current month. I tried the ascending/descending in the database but I can't seem to get the months in the right order. How do I do this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Open the attached file. I created a dummy table "Sales", then created the Calendar table like I told you, then created the relationship and you'll see the date hierarchy on the Calendar Table.

 

https://www.dropbox.com/s/xhj8oz54j1agp6k/Sample.pbix?dl=0

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Do you have a Calendar table? Could you send a print of the field list (on the right)?

fields.PNG

Anonymous
Not applicable

OK, so you should add a Calendar table first, clik "Add Table" and write like:

 

Table Name = CALENDAR (FIRSTDATE(Reference to date formatted column in data source),LASTDATE(Reference to date formatted column in data source))

Then you should connect the date on the Table you created with the date on the Fact table.

 

From now on you'll use the date table for everything (calculations, fields on visuals, etc.).

 

There will probably be a new Date Hierarchy on the new Date Table, if there isn't, create it (right click...).

 

After this you'll have Year, Quarter, Month and Day fields and the sorting is always good.

thank you for your answer. I tried to fill in the right dates but I can't seem to get it.

I have a colum in excel with Year and Month. which is 2018 and the months in text: june, july, august..

What do I need to fill in?

calander.PNG

Anonymous
Not applicable

Calender = CALENDAR(FIRSTDATE('FactTable'[Date]);LASTDATE(FactTable'[Date]))

Change the name of table and column. This way you have a dynamic Calendar Table always depending on Fact table, which is the recommended way.

I only get errors. This is my data. So what do I need to fill in after FIRSTDATE(. Because I get errors if I fill in dates like 1, 8, 2018 and I get errors if I fill in Juni, 2018. So I don't get it. Do I need to make other tables in excel first?

data.PNG

Anonymous
Not applicable

Does it work for you?

Yes! Thank you so much!

Anonymous
Not applicable

Open the attached file. I created a dummy table "Sales", then created the Calendar table like I told you, then created the relationship and you'll see the date hierarchy on the Calendar Table.

 

https://www.dropbox.com/s/xhj8oz54j1agp6k/Sample.pbix?dl=0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.