Forum Discussion
AlexOakman
3 years agoFrequent Visitor
SUMMARAZE performance / early materialization
Hi, I have a large fact table. I need to calculate a tricky measure. The first step I need to group this table by a certain set of attributes, excluding repetitions, and then find the sum over the re...
johnt75
Super User
3 years agoIf you have a relationship from your date table to the fact table then there is no need to apply the date filters to your fact table and you could simplify the code to
TEST_v1 =
VAR _tbl2 =
ADDCOLUMNS (
SUMMARIZE (
'Test_balance',
'bridge_dpd_addition'[dpd_group_company],
'Test_balance'[prolongation_num_cumulative],
'Test_balance'[amount_usd]
),
"cnt", CALCULATE ( DISTINCTCOUNT ( 'Test_balance'[credit_key] ) )
)
VAR _res =
SUMX ( _tbl2, [amount_usd] * [cnt] )
RETURN
_res
- AlexOakman3 years agoFrequent Visitor
I need to calculate cumulative values for the month by day. Something like that: