0

I'm trying to create table summary table with following conditions

enter image description here

From the Original table to summary table we have to create using the following conditions

1) select distinct ids
2) select screen name base on highest count group by id and today date
3) If two screens are same value on today date with the same id then pick the first screen
KARTHIKEYAN.A
  • 18,210
  • 6
  • 124
  • 133

2 Answers2

1

You could create a Rank calculation using the following formula:

Rank = IF(Original[Start Date]=TODAY(),RANKX(CALCULATETABLE(Original,ALLEXCEPT(Original,Original[ID])),Original[Count]),0)

Output:

enter image description here

You should replace "Original" with your table name in the calculation. Once the Rank is created, you can just filter for Rank=1 and you should have the desired result. Hope this helps.

KARTHIKEYAN.A
  • 18,210
  • 6
  • 124
  • 133
CR7SMS
  • 2,520
  • 1
  • 5
  • 13
1

This yields the desired result as a calculated table.

SummaryTable = 
ADDCOLUMNS(
    ADDCOLUMNS(
        FILTER(
            SUMMARIZE(
                OriginalTable,
                OriginalTable[ID],
                OriginalTable[StartDate]
            ),
            OriginalTable[StartDate] = TODAY()
        ),
        "Count", CALCULATE( MAX( OriginalTable[Count] ) )
    ),
    "Screen",
    VAR CurrentCount = [Count]
    RETURN CALCULATE( MIN(OriginalTable[Screen]), OriginalTable[Count] = CurrentCount )
)

Output:

result

KARTHIKEYAN.A
  • 18,210
  • 6
  • 124
  • 133
Kosuke Sakai
  • 2,336
  • 2
  • 5
  • 12