Forum Discussion
srk_powerbi
5 years agoHelper II
Calculation help needed
Hi , i need osme help calculating a measure. i have below 2 tables. Both are related by AccountNum coulumn. I need to calculate Measures for 1. calculate the Count(AccountNum) where RegisteredDat...
- Anonymous5 years ago
Hi srk_powerbi ,
Based on your description, you can create some measures as follows.
count_today = CALCULATE(COUNT('Table 1'[AccountNum]),'Table 1'[RegisteredDate]=TODAY()-1)
count_previous =
var x1 = MAXX(FILTER(ALL('Table 1'),[RegisteredDate]<TODAY()-1&&WEEKDAY('Table 1'[RegisteredDate],2)<6),'Table 1'[RegisteredDate])
return
CALCULATE(COUNT('Table 1'[AccountNum]),'Table 1'[RegisteredDate]=x1)
sum_today = CALCULATE(SUM('Table 2'[Amount]),'Table 1'[RegisteredDate]=TODAY()-1)
sum_previous =
var x1 = MAXX(FILTER(ALL('Table 1'),[RegisteredDate]<TODAY()-1&&WEEKDAY('Table 1'[RegisteredDate],2)<6),'Table 1'[RegisteredDate])
return
CALCULATE(SUM('Table 2'[Amount]),'Table 1'[RegisteredDate]=x1)Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
5 years agoNot applicable
I assume that you have a calender table, try adding following column:
PrevBusinessdAy =
MAXX(
FILTER('Calendar';'Calendar'[Date] < EARLIER('Calendar'[Date])
&& WEEKDAY('Calendar'[Date];3) <5);
'Calendar'[Date]
)Then create the measures.