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
Anonymous
Not applicable

Time Intelligent Slicer to change X-Axis(Year/Month/Day)

Hi there @amitchandak @parry2k  @AlB and everyone else

I have created a dynmic slicer consistring of Day, Month and Year. When selecting the Month from slicer it automatically updates the x axis on my bar chart, similar for the day as well. The issue I'm having is that the months and days are out of order.

jalmendarezSOG_0-1595443796284.png

 
 
 

month.PNG

The way I acheived this I created a table with the three types (month, day, year) in one column, and then all the value types based on my data

 

Capture.PNG

 

The actual values are from a measure I calculated inside the above table. These two tables are what I use to create the bar graph. The bar graph as an axis of "Values" which are picked from the slicer "type", and the values of the bar graph comes from the "Measure SN DT"capture 2.PNG

 

Is there a way to sort the table or measure so that the months and days are displayed in order (jan,feb,march....) and (1,2,3,4,5,6,7)?

Thanks!

2 ACCEPTED SOLUTIONS

@Anonymous - It's a little difficult to tell how to get this extra sort by column in there since you are creating the table in DAX. Probably possible but can you maybe post some sample source data for the table you are cross joining, I think it is your CATARINA GL DATE table?

 

This might also help: https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Mythical-DAX-Index/m-p/1093214#M528

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Anonymous
Not applicable
10 REPLIES 10
Anonymous
Not applicable

@Greg_Deckler  is correct your having this issue because your column is set to text.  you need ot create a proper calendar table has a column for each similar to the below 

Dnerada_0-1595456235540.png

 

Anonymous
Not applicable

The simplest way would be to add an index column. Then add the index column to the tooltips section under visualization, then click the three dots on the top right and go to sort, sort by index, sort ascending. 

 

Karlos_0-1595453605656.png

 

Anonymous
Not applicable

@Anonymous 

Any guidance on cdoe the new index column? How would it know to categorize months in order and the days?

@Anonymous - It's a little difficult to tell how to get this extra sort by column in there since you are creating the table in DAX. Probably possible but can you maybe post some sample source data for the table you are cross joining, I think it is your CATARINA GL DATE table?

 

This might also help: https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Mythical-DAX-Index/m-p/1093214#M528

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler @Anonymous here's a link to the raw data and stripped down version of the PBI. Really appreciate the help. Reading your article right now 

https://drive.google.com/drive/folders/1sS3T2ItgHs32jDAW708bfpYpWHzcEyRd?usp=sharing 

Anonymous
Not applicable

Anonymous
Not applicable

Great solution! I"m sure this way should be faster as its loading in the powerquery instead of doing it as tables.
Thanks!

Anonymous
Not applicable

@Anonymous @Anonymous @Greg_Deckler  Thanks for the input guys, I got it to work! 
Created an Index Table as @Greg_Deckler  mentioned in the article attachedindex.PNG

 

Then I made a the relationship between my table with all the measures for the slicer and the new index table connecting my "Values"
relationship.PNG
Finally took @Anonymous note and added the "Index" column as a tool tip in my graph and then sorted the graph by "Index"
Now the dates are in chronological order! THanks everyone!!

I'm sure there's probably a more effiecnt way of doing this...like creating an index column in the original slicer table without having to make another table. Will do some digging to clean it up but really thankful for everyones help!

Greg_Deckler
Super User
Super User

@Anonymous - Well, you probably need another numeric column that has values 1 - 12 for the months, 1 - 31 for the days, etc. Use Sort By functionality to sort your one field by this new field.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for reploy @Greg_Deckler , any guidance on what forumlas to use to create the new column?
Also if I load historic data then I will end up having more than just one year. Currently have 2020 data, but soon will have 2017-today. I'm assuming I'd have to give those numeric values 1-4 for the years correct?

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.

Top Solution Authors
Top Kudoed Authors