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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bullius
Helper V
Helper V

Running total using start and end dates with no date table

Hi

 

I have data that includes an "Activation Date" column and a "Cancellation Date" column. I want a line graph with date on the x axis, showing the total on any given date.

 

I have done this on another .pbix by creating an "All" table and a "Cancelled" table, subtracting the Cancelled from the All and creating a date table to link them together:

 

Running Total = (CALCULATE(DISTINCTCOUNT('All'[Item]), FILTER(ALL('Date'[Date]), 'Date'[Date]<=MAX('Date'[Date]))))-(CALCULATE(DISTINCTCOUNT('Closed'[Item]), FILTER(ALL('Date'[Date]),'Date'[Date]<=MAX('Date'[Date]))))

 

However, this time I am using Direct Query and cannot create a Date Table.

 

Is there a way to create an equivalent measure without one?

 

Thanks!

1 REPLY 1
v-yuezhe-msft
Employee
Employee

Hi @bullius,

Do you connect to SQL Server database via DirectQuery mode in Power BI Desktop? If that is the case, you can create a date table in your current database following the instructions in this blog , then import the date table from SQL Server into the current pbix file.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.