Forum Discussion
ahhk2000
Feb 17, 2021Copper Contributor
Power Pivot values based on criteria
Hi Forum, advice appreciated on this situation based on the attached sheet. I made this sample on a Mac (no Power Pivot in Excel) , the actual situation is at work with a large data model involved. ...
- Feb 17, 2021
If without data model you may add two helper columns
as
=COUNTIFS([Company],[@Company]) and =MIN(TODAY()-MAXIFS([Service Date],[Service Type],"High Touch",[Company],[@Company]),40000)With that you may add slicers on these fields and move somewhere away, e.g. into separate hided sheet.
If you shift on Windows or one day Power Pivot appears on Mac, you may add two measures and use them in PivotTable (green one)
Count of Clients:=VAR cnt=COUNTROWS(Table1) VAR DaysSince=CALCULATE( TODAY()-MAX(Table1[Service Date]), FILTER(Table1, Table1[Service Type]="High Touch") ) RETURN IF( OR(DaysSince=TODAY(), cnt<2), BLANK(), cnt) and Days since High Touch:=VAR cnt=COUNTROWS(Table1) VAR DaysSince=CALCULATE( TODAY()-MAX(Table1[Service Date]), FILTER(Table1, Table1[Service Type]="High Touch") ) RETURN IF( OR(DaysSince=TODAY(), cnt<2), BLANK(), DaysSince)
SergeiBaklan
Feb 17, 2021Diamond Contributor
If without data model you may add two helper columns
as
=COUNTIFS([Company],[@Company])
and
=MIN(TODAY()-MAXIFS([Service Date],[Service Type],"High Touch",[Company],[@Company]),40000)
With that you may add slicers on these fields and move somewhere away, e.g. into separate hided sheet.
If you shift on Windows or one day Power Pivot appears on Mac, you may add two measures and use them in PivotTable (green one)
Count of Clients:=VAR cnt=COUNTROWS(Table1)
VAR DaysSince=CALCULATE(
TODAY()-MAX(Table1[Service Date]),
FILTER(Table1, Table1[Service Type]="High Touch")
)
RETURN
IF( OR(DaysSince=TODAY(), cnt<2), BLANK(), cnt)
and
Days since High Touch:=VAR cnt=COUNTROWS(Table1)
VAR DaysSince=CALCULATE(
TODAY()-MAX(Table1[Service Date]),
FILTER(Table1, Table1[Service Type]="High Touch")
)
RETURN
IF( OR(DaysSince=TODAY(), cnt<2), BLANK(), DaysSince)ahhk2000
Feb 23, 2021Copper Contributor
Thank you so much for the detailed and informative feedback. Very grateful for your help! SergeiBaklan
- SergeiBaklanFeb 23, 2021Diamond Contributor
ahhk2000 , you are welcome, glad to help