cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
2makeitwork
Frequent Visitor

PowerApps - newbie questions

New to Power* suite of products. Have 2 general questions about PowerApps.

1. In Excel, MODE is a function that finds the most occurring record in a data set. I can't seem to find the equivalent syntax in PowerApps. Anyone know what it is? If there isn't an equivalent formula (yet), what is the workaround? I have created the measure in PBI and it carries over to PAPPS through the integration connection, but I cannot display it correctly because the default gallery is list, which leads me to my second question.

2. When I create a normal gallery or any other labels, text, etc. to try and display the custom PBI measure, how do I connect it using the pbiintegration connection? It doesn't show up as data source to select (maybe that's now its suppose to work). 

 

Thanks for helping someone new to the programs. There's lots to learn.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Here's my revised answer. This works with text.

 

First(
    Sort(
        AddColumns(AddColumns(YourDataSource,"MatchName","MATCH"&YourDataColumn),
        "ModeNumber",
        CountRows(Filter(YourDataSource,"MATCH"&YourDataColumn=MatchName))),
    ModeNumber,Descending)
).YourDataColumn

 

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

**Retracting my answer, found a bug in the code. Looking into it now.

Thanks for the quick response. Will this work with text or numbers datatype in the record? The record I'm looking to display is a text datatype.

Anonymous
Not applicable

Here's my revised answer. This works with text.

 

First(
    Sort(
        AddColumns(AddColumns(YourDataSource,"MatchName","MATCH"&YourDataColumn),
        "ModeNumber",
        CountRows(Filter(YourDataSource,"MATCH"&YourDataColumn=MatchName))),
    ModeNumber,Descending)
).YourDataColumn

 

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Dumb question but in your formula, I only need to replace YourDataSource and YourDataColumn correct?

I'll test it at work tomorrow and let you know if it works. Thanks again the for quick response. Definitely will give Thumbs Up if this works.

Anonymous
Not applicable

Yes, that's correct! Let me know if you run into any issues with it.

OK had a chance to test the script. Ran into 2 issues:

1. The powerbiintegration data source handle is problematic. With your code it produced a different outcome than the definition. Coupled with other issues (connection & refresh reliability, other instability), I abandoned the whole PowerBI and PowerApp integration connector. Its very buggy for a regular user like me and since I don't have a premium plan, other PBI linkage solutions are not available.

2. Small issue with your code. The ending .Name will show "MATCH" in front of every result. So I replaced it with the name of the record that I want to show, and bam, it works!

 

First( Sort(
AddColumns(AddColumns(YourDataSource,"MatchName","MATCH"&YourDataColumn),
"ModeNumber",
CountRows(Filter(YourDataSource,"MATCH"&YourDataColumn=MatchName))),
ModeNumber,Descending)
).YourDataColumn

 

So the solution works, albeit with some caveats. Thanks again for your help and quick response!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,464)