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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
ROG
Responsive Resident
Responsive Resident

Calculated column in DirectQuery source not working.

Hi guys,

Can you please help me out in creating some calculated columns using the only date column I have from data source?

It's DirectQuery and I need toextract year, month, and week. 

I tried thebelow, but it's not possible.

ROG_0-1659000120377.png

 



Thank you

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @ROG 

Thanks for reaching out to us.

You can try this,

vxiaotang_1-1659433055524.png

vxiaotang_0-1659432986536.png

create the measure

Measure = CALCULATE(COUNT(subscriber[subscriber]),FILTER(subscriber,YEAR(subscriber[date])= MIN('calendar'[year]) && MONTH(subscriber[date])=MIN([month])))

vxiaotang_3-1659433123693.png

 

Best Regards,

Community Support Team _Tang

If this post helps, 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-xiaotang
Community Support
Community Support

Hi @ROG 

Thanks for reaching out to us.

You can try this,

vxiaotang_1-1659433055524.png

vxiaotang_0-1659432986536.png

create the measure

Measure = CALCULATE(COUNT(subscriber[subscriber]),FILTER(subscriber,YEAR(subscriber[date])= MIN('calendar'[year]) && MONTH(subscriber[date])=MIN([month])))

vxiaotang_3-1659433123693.png

 

Best Regards,

Community Support Team _Tang

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

amitchandak
Super User
Super User

@ROG , Try functions like day, month, year etc. As Power bi limits what you can do in direct query, I advise to bring them from the database

 

Power BI Decoding Direct Query: https://www.youtube.com/playlist?list=PLPaNVDMhUXGbKatyDdOhGbTL3xW2Xy6pA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
ROG
Responsive Resident
Responsive Resident

Thanks @amitchandak 

I have the Calendar table from database, but I can't get the Number of subscribers by month/year using the columns from the calendar table. 
As you can see below, they're not connected directly. What should I do? 😕

 

ROG_0-1659003035832.png

 



Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.

Top Solution Authors