Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
adp_81
Frequent Visitor

Showing maximun value in Card

I have a table, something like:

DateNum_Connections
2021-01-015
2021-01-0210
2021-01-031
2021-01-045
......

 

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! 

 

1 ACCEPTED SOLUTION

@adp_81 

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])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@adp_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] )

Fowmy_0-1650402635706.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

adp_81
Frequent 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])+0

 

I'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

@adp_81 

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])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks ryan_mayu!

 

That worked perfectly!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.