Forum Discussion
adp_81
4 years agoFrequent Visitor
Showing maximun value in Card
I have a table, something like: Date Num_Connections 2021-01-01 5 2021-01-02 10 2021-01-03 1 2021-01-04 5 ... ... I would like to show in a Card the maximum Num_Connec...
- 4 years ago
maybe you can try this
Measure 2 = maxx(values('Table'[Date]),[Num_Connections]) Measure 3 = VAR tbl= SUMMARIZE('Table','Table'[Date],"connections",distinctcount('Table'[Num_Connections])) VAR tbl2=ADDCOLUMNS(tbl,"CHECK",RANKX(TBL,[connections],,DESC)) return maxx(FILTER(tbl2,[CHECK]=1),'Table'[Date])
Fowmy
Super User
4 years agoadp_81
Measure for Max Num Conn
Max Num Conn = MAX(Tablename[Num_Connections])
Measure for Date of the Max Num Conn
Max Num Conn Date =
VAR __MAX = [Max Num Conn]
RETURN
MAXX( FILTER( ALL(Tablename[Date]), [Max Num Conn] = __MAX ) , Tablename[Date] )
- adp_814 years agoFrequent Visitor
Hello Fowny,
Thank you for your reply. I forgot to mention that my Num_Connections column is a measure... its formula is:
Num_Connections = DISTINCTCOUNT(connections[userId])+0I've been googling about it and found this formula:
MaxConnections = MAXX(ALL(connections), Num_Connections)
but it is not working. I also tried:
MaxConnections = MAXX(ALL(connections), DISTINCTCOUNT(connections[userId]))which does not work either.Any ideas?Thanks- ryan_mayu4 years ago
Super User
maybe you can try this
Measure 2 = maxx(values('Table'[Date]),[Num_Connections]) Measure 3 = VAR tbl= SUMMARIZE('Table','Table'[Date],"connections",distinctcount('Table'[Num_Connections])) VAR tbl2=ADDCOLUMNS(tbl,"CHECK",RANKX(TBL,[connections],,DESC)) return maxx(FILTER(tbl2,[CHECK]=1),'Table'[Date])- adp_814 years agoFrequent Visitor
Thanks ryan_mayu!
That worked perfectly!