The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance 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 |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
21 | |
14 | |
14 | |
9 | |
7 |