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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Data Weird Problem

Hello, 

I have a problem using power BI direct quiery.

I'm working with data date, and even if in power BI editor quiery the values are recognized as a date, when I use the data for the creation of contents, they are seen as nominal data. Losing the possibility to select and show just the months for example.. 

How can I do? Thanks in advance 🙂 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

There is no built-in date hierarchy when use DirectQuery. You may try creating a hierarchy manually as below.

Temp:

c1.png

 

You may create two calculated column as below.

Year = YEAR([Date])
Month = MONTH([Date])

 

Then you could right-click the 'Year' column=>'new hierarchy'=>drag 'Month' column into the hierarchy.

c3.pngc2.png

 

Result:

c4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

There is no built-in date hierarchy when use DirectQuery. You may try creating a hierarchy manually as below.

Temp:

c1.png

 

You may create two calculated column as below.

Year = YEAR([Date])
Month = MONTH([Date])

 

Then you could right-click the 'Year' column=>'new hierarchy'=>drag 'Month' column into the hierarchy.

c3.pngc2.png

 

Result:

c4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks @avatorl for the reply. I try to explain me better. 

The main problem is when I work with the direct query. My goal is to create a graph like this one: 

1.PNG

In which my data are divided per month, and this I can easily do it with the static data, because the value of the date are recognized as such. And I can easily filter directly from the axis. (like this)

2.PNG

On the contrary, when using direct query, it does not recognize the date! And is almost impossible to me show the division per month but only per day! And I have something like this!

3.PNG

 

I also tried coding, but it says to me that is impossible using direct query. 
It's all the morning I look for this solution, but I can't find it the appropriate one... 
I'll be glad if you can help me!!!

avatorl
Impactful Individual
Impactful Individual

If I understand you correct you're looking for something similar to Excel filters where you can select/deselect the entire month or year when filtering date column. This is now how it works in Power Query. To filter your data by year/month without manual code editing use Date Filters menu:

avatorl_0-1612358998428.png

 

For more advanced filtering you can edit M code manually to add a required combination of Date.Year(), Date.Month() and/or other Date functions.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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