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_Connections (10) and in another card the date in which that max was achieved (2021-01-02)
Can this be done?
Thanks!
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])
5 Replies
- adp_81Frequent 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_mayu
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])