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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ItoDiaz
Helper I
Helper I

Date sort with query M

Hello everyboby, 

 

I'm a little bit disappointed as I have tried to do a "Date Sort" table using query M. I have followed the procedure described in this post : 

 

https://blog.crossjoin.co.uk/2016/05/30/creating-current-day-week-month-and-year-reports-in-power-bi... 

 

I have adapted this code to have date sorts I need. I have followed all the steps, but when I create my slicer to apply my sorts, it doesn't works 😞

Slicer.JPG

 

I have made these relationships like the blog suggest. The main difference is that in the blog's "Data" table there is just a row by date, in my case, I have severals attributs for the same datatime (I have changed the type to date for visuals porpuses), it means several rows for a same datetime. I have tried to change the relationships without sucess. 

Relations.JPGI have tried spliting my "Period" table but it doesn't works either. 

 

Can someone give me some suggestions or solutions to solve this problem? 

 

Thanks in advance. 

1 ACCEPTED SOLUTION
ItoDiaz
Helper I
Helper I

Hello @Daryl-Lynch-Bzy , 

 

Thanks for your answer. Unfortunately I have not admin rights and I can't install the External tools. 
I have found this link and after some modifications and added calculated columns, it seems to work. 

 

https://powerbi.tips/2017/11/creating-a-dax-calendar/ 

View solution in original post

2 REPLIES 2
ItoDiaz
Helper I
Helper I

Hello @Daryl-Lynch-Bzy , 

 

Thanks for your answer. Unfortunately I have not admin rights and I can't install the External tools. 
I have found this link and after some modifications and added calculated columns, it seems to work. 

 

https://powerbi.tips/2017/11/creating-a-dax-calendar/ 

Daryl-Lynch-Bzy
Community Champion
Community Champion

Hi @ItoDiaz - I think you should consider creating a Calculation Group instead.  Chris's blog is from a few years ago prior to the introduction of calculation groups.  Here is an introduction to Calculation Groups: REDUCE the # of measures with Calculation Groups In Power BI - YouTube


Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.