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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
BenChain
Frequent Visitor

Direct query - matrix - days until today

Hi Helpers

 

I am trying to make a matrix like so, where I am comparing a date vs today and creating buckets from them the splitting the count by status

 

  Days vs today  
  0-56-2021-100
StatusesA546655
 B234868
 C8234112

 

 

I put the values in, and the rows. But I am struggling with the columns.

 

A date diff measure doesn't seem to work

 

It doesn't have to be in buckets, though that is preferred. Just # of days is fine as integers

 

I have a direct query connection.

 

Is this possible? I know I can just make a calculated column in import mode, but Direct Queries limitations are stressing me out. But it's needed because we need live data.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@BenChain , Direct Query mode also you can have columns but there are limitations.

In the case of SQL Server, it allowed creating a new column like

 

 

Column = DATEDIFF([Sales Date],today(),day)

 

 

 

If you want the measure to display as a column/row, You need to have an independent table and create a measure that joins this measure and that table using some group by level

refer video - https://www.youtube.com/watch?v=CuczXPj0N-k

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@BenChain , Direct Query mode also you can have columns but there are limitations.

In the case of SQL Server, it allowed creating a new column like

 

 

Column = DATEDIFF([Sales Date],today(),day)

 

 

 

If you want the measure to display as a column/row, You need to have an independent table and create a measure that joins this measure and that table using some group by level

refer video - https://www.youtube.com/watch?v=CuczXPj0N-k

 

Thank you very much! I don't know why every resource I read told me I could only add column in Import mode. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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