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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cumulative Measure issue with Direct Query Mode

Hi Expert

 

How do you get around the following issue when writing cumulative measures in Direct Query Mode....

See image

Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

Here are the Measures in Question - Measures 

 
1.
Cumulative Today =
CALCULATE (
[Total Sales],
FILTER (
ALLSELECTED ( FACTSalesOrderTable ),
FACTSalesOrderTable[created_at_sales_flat_order] <=max ( FACTSalesOrderTable[created_at_sales_flat_order] )
)
)
 
 
2.
Cumulative Previous Weeks =
CALCULATE(
[Previous Weeks],
FILTER(
ALLSELECTED('FACTSalesOrderTable'[created_hour]),
ISONORAFTER('FACTSalesOrderTable'[created_hour], MAX('FACTSalesOrderTable'[created_hour]), DESC)
)
)
 
3.
Cumulative Previous Year =
CALCULATE(
[Previous Year],
FILTER(
ALLSELECTED('FACTSalesOrderTable'[created_hour]),
ISONORAFTER('FACTSalesOrderTable'[created_hour], MAX('FACTSalesOrderTable'[created_hour]), DESC)
)
)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , do some of these dates have timestamp, if that is not needed in the visual create date without timestamp and use those in meausre.Or Join Dates with the date of date table and try using date of date table in place of these dates in cumulative logic

 

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , do some of these dates have timestamp, if that is not needed in the visual create date without timestamp and use those in meausre.Or Join Dates with the date of date table and try using date of date table in place of these dates in cumulative logic

 

 

Anonymous
Not applicable

Hi Amit Checking.....And how would the dates from the date table work?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.