cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User
Super User

Re: PowerApps - newbie questions

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
Highlighted
Super User
Super User

Re: PowerApps - newbie questions

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

Highlighted
Frequent Visitor

Re: PowerApps - newbie questions

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.

Highlighted
Super User
Super User

Re: PowerApps - newbie questions

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

Highlighted
Frequent Visitor

Re: PowerApps - newbie questions

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.

Highlighted
Super User
Super User

Re: PowerApps - newbie questions

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

Highlighted
Frequent Visitor

Re: PowerApps - newbie questions

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,570)