Forum Discussion
wimsangers
Helper I
7 years agoCount cumulative with inactive relationship
Hi all, I am trying to calculate a cumulative measure with an inactive relationship. This is the formula I use. charging points = calculate(COUNTA(ChargePoints[ExternalID]);USERELATIONSHIP...
- 5 years ago
Hi AsMoBhosca ,
It is already a long time ago, but I think I managed to fix the problem thanks to the tip of MattAllington.
If you look at the code of my original problem this is the updated version:
calculate(COUNTA('bi chargecard_assignment'[evco_id]),filter(ALL('Calendar for cards'[Date]),'Calendar for cards'[Date] <= MAX('Calendar for cards'[Date])),'bi chargecard_assignment'[assigned_until] <> BLANK(),USERELATIONSHIP('Calendar for cards'[Date],'bi chargecard_assignment'[assigned_until])) + calculate(COUNTA('bi chargecard_assignment'[evco_id]),filter(ALL('Calendar for cards'[Date]),'Calendar for cards'[Date] <= MAX('Calendar for cards'[Date])),'bi chargecard_assignment'[assigned_until] > TODAY(),USERELATIONSHIP('Calendar for cards'[Date],'bi chargecard_assignment'[assigned_until]))Hope it helps you.
AsMoBhosca
5 years agoFrequent Visitor
Hi,
wimsangers
Did you ever figure out how to correctly nest the calculate functions? I am also trying to get a cmulative count using an inactive relationship.
Thanks
- wimsangers5 years ago
Helper I
Hi AsMoBhosca ,
It is already a long time ago, but I think I managed to fix the problem thanks to the tip of MattAllington.
If you look at the code of my original problem this is the updated version:
calculate(COUNTA('bi chargecard_assignment'[evco_id]),filter(ALL('Calendar for cards'[Date]),'Calendar for cards'[Date] <= MAX('Calendar for cards'[Date])),'bi chargecard_assignment'[assigned_until] <> BLANK(),USERELATIONSHIP('Calendar for cards'[Date],'bi chargecard_assignment'[assigned_until])) + calculate(COUNTA('bi chargecard_assignment'[evco_id]),filter(ALL('Calendar for cards'[Date]),'Calendar for cards'[Date] <= MAX('Calendar for cards'[Date])),'bi chargecard_assignment'[assigned_until] > TODAY(),USERELATIONSHIP('Calendar for cards'[Date],'bi chargecard_assignment'[assigned_until]))Hope it helps you.