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
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
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.