Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a basic data model with 4 tables: 1 fact table and 3 dimensions table. One of the dimension tables is a date table. The fact table contains c. 1.1 million rows.
This is the measure I would like to optimise, if possible:
VAR WeekEnding = SELECTEDVALUE(Dates[FinancialWeekEnding],MAX(Dates[FinancialWeekEnding]))
RETURN
CALCULATE(COUNTROWS(Fact),
ALL(Dates),
Fact[Completed Date Calculated] > WeekEnding || ISBLANK(Fact[Completed Date Calculated]),
Fact[IssuedDate] <= WeekEnding,
Fact[Cancelled Date Calculated] > WeekEnding || ISBLANK(Fact[Cancelled Date Calculated])
)
The purpose is to place to measure on a line chart with dates on the x axis and the result will show the number of open cases in the Fact table at the date - my logic is get the date at the data point, remove filters from the Dates table and then check if the case was created on or before said date and was either not cancelled or cancelled after and not closed or closed after. As I type, I wonder if REMOVEFILTERS would be quicker than ALL..
Measure currently calculates in about a minute but responded very slowly, or not at all, to slicers. Any ideas to improve this calculation time? Thanks.
@Anonymous , Try like
VAR WeekEnding = SELECTEDVALUE(Dates[FinancialWeekEnding],MAX(Dates[FinancialWeekEnding]))
RETURN
CALCULATE(COUNTROWS(Fact),
filter(Fact,
Fact[Completed Date Calculated] > WeekEnding || ISBLANK(Fact[Completed Date Calculated]),
Fact[IssuedDate] <= WeekEnding,
Fact[Cancelled Date Calculated] > WeekEnding || ISBLANK(Fact[Cancelled Date Calculated])
), all(Date) )
or use crossfilter to remove the join
example
Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU
Hi, I am not sure that is going to work as FILTER accepts 2 arguments only?
I can remove the commas and replace with && but that just returns a blank value. I'm not sure why using FILTER would improve the calcualtion speed?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |