Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Single Tran1 =
Var table1=
SUMMARIZE(
FILTER(V_STORE_TRAN_FACT,'V_STORE_TRAN_FACT'[Year]=[FY] && 'V_STORE_TRAN_FACT'[Week2]=[WK] ),
V_STORE_TRAN_FACT[STORE_KEY],
V_STORE_TRAN_FACT[TRANSACTIONID],
"T1",Sum('V_STORE_TRAN_FACT'[TRANS_QTY]))
Return
COUNTX(FILTER(table1,[T1]=1),[TRANSACTIONID])
Hi @Anonymous
Actually, the inner FILTER is the oart of the code that consumes most of the time. It includes the evaluation of two measures at each iteration. I see that this filter is absolutely not required. The table is already filtered by the year and week available in the current filter context.
I guess by removing it, the results shall remain unchanged.
Single Tran1 =
VAR table1 =
SUMMARIZE (
V_STORE_TRAN_FACT,
V_STORE_TRAN_FACT[STORE_KEY],
V_STORE_TRAN_FACT[TRANSACTIONID],
"T1", SUM ( 'V_STORE_TRAN_FACT'[TRANS_QTY] )
)
RETURN
COUNTROWS ( FILTER ( table1, [T1] = 1 ) )
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |