Forum Discussion
gringo89
6 years agoHelper I
Count step stock at specific date
Hi, Firstly, sorry for my english. We want to restitute the number of document on each status by date. My fact table likes : users Date event Type event 1 01/03/2020 Sended 1 04/...
v-lid-msft
6 years agoCommunity Support
Hi gringo89 ,
We can use the following steps to meet your requirement.
- add an index column for fact table in Power Query.
- And we need to create relationships between tables,
- Then we can create a measure to get the result,
Measure =
COUNTROWS (
FILTER (
SUMMARIZE (
FILTER (
ALLSELECTED ( 'fact table' ),
'fact table'[Date event] <= MIN ( 'Dim Date'[Date] )
),
'fact table'[users],
"LastType",
VAR maxIndex =
CALCULATE (
MAX ( 'fact table'[Index] )
)
RETURN
CALCULATE (
MAX ( 'fact table'[Type event] ),
'fact table'[Index] = maxIndex
)
),
[LastType] IN DISTINCT ( 'Dim Type event'[Type event] )
)
) +0
BTW, pbix as attached.
Best regards,
- gringo896 years agoHelper I
Hi v-lid-msft
thanks for you're help.
I think that this approach can resolve my requirement.
I use SSAS (2016 version) live connection and i have an error with 'IN DISTINCT' syntax. I don't understand...