Forum Discussion
ClemFandango
3 years agoAdvocate II
Dax conditional If statement for counting rows in date table
Hello all, I am trying to use CountRows, but toiling a bit with a conditional if statement. I have the following date table called MMYYDD MMYYDD Count 31/01/2018 3 28/02/2018 3 31/03...
- 3 years ago
here's a general idea of how to implement that
ct2 =
VAR a =
SUMMARIZE(
MMYYDD,
MMYYDD[MMYYDD],
"ct",
VAR d = [MMYYDD]
RETURN
CALCULATE(
COUNTROWS( Summary ),
COALESCE( Summary[RejoinDate], Summary[MinDate] ) <= d,
COALESCE( Summary[DateEnd], Summary[MaxDate] ) > d
)
)
RETURN
SUMX( a, [ct] )You can refine the logic by testing for both conditions together.
ClemFandango
3 years agoAdvocate II
Great stuff, thanks lbendlin