Forum Discussion
VModani
4 years agoFrequent Visitor
How to avoid double counting when an item links to multiple items in a different column
I have data that among other things contains names and Offer/Reject action. I want to find how many names are in each action Reject or Accept. I can create 2 seperate measures for both actions and do...
- 4 years ago
Hi,
I am not quite sure which action does Mike belong to. On the same day, Mike's result is Reject and Offer.
I guess Mike belongs to both, and the below calculation shows like this.
Please check the attached pbix file.
Distinctcount name by last action only: =IF (HASONEVALUE ( Data[Action] ),CALCULATE (COUNTROWS ( Data ),TREATAS (GROUPBY (ALL ( Data ),Data[Name],"@lastactiondate", MAXX ( CURRENTGROUP (), Data[Date] )),Data[Name],Data[Date])))
Jihwan_Kim
Super User
4 years agoHi,
I am not quite sure which action does Mike belong to. On the same day, Mike's result is Reject and Offer.
I guess Mike belongs to both, and the below calculation shows like this.
Please check the attached pbix file.
Distinctcount name by last action only: =
IF (
HASONEVALUE ( Data[Action] ),
CALCULATE (
COUNTROWS ( Data ),
TREATAS (
GROUPBY (
ALL ( Data ),
Data[Name],
"@lastactiondate", MAXX ( CURRENTGROUP (), Data[Date] )
),
Data[Name],
Data[Date]
)
)
)
VModani
4 years agoFrequent Visitor
Sorry for not making the sample properly. Mike belongs to the Offered action. I think date/time datatype can solve that. The solution itself if working. Thank You!