Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi, I am trying to calculate Mode from existing queries
Example:
product | price |
a123 | 1.2 |
a235 | 1.5 |
a123 | 1.2 |
a123 | 1.2 |
a123 | 1.3 |
a126 | 0.3 |
i am trying to calculate the mode price for produce a123 - in this case it would be 1.2
This table is in another query, and I was thinking to create a separate query which would have my mode calculation result below:
product | price (mode) |
a123 | 1.2 |
a126 | 0.3 |
a235 | 1.5 |
Any suggestions would be incredibly helpful! Thanks!
Solved! Go to Solution.
@jaclynt8
Note >> here is Two Solutions but useful First soutions bcoz second Solution in use duplicates table and it is Load our dataset .
>> Right Click on Product Column >> Remove Duplicates >> Get Your Out-Put.
***************************************** Second Solutions ***********************************
>>Create Product Dulicates table >> Go to Dulicates table Home tab ribbon Advance Editor >> clear all M code and>>Add Below M Code.
let
Source = Product,
#"Grouped Rows" = Table.Group(Source,"Product",{"Price", each List.Mode([Price])})
in
#"Grouped Rows"
here you get your expected result.
If this post helps, please consider accept as solution to help other members find it more quickly.
@jaclynt8
Note >> here is Two Solutions but useful First soutions bcoz second Solution in use duplicates table and it is Load our dataset .
>> Right Click on Product Column >> Remove Duplicates >> Get Your Out-Put.
***************************************** Second Solutions ***********************************
>>Create Product Dulicates table >> Go to Dulicates table Home tab ribbon Advance Editor >> clear all M code and>>Add Below M Code.
let
Source = Product,
#"Grouped Rows" = Table.Group(Source,"Product",{"Price", each List.Mode([Price])})
in
#"Grouped Rows"
here you get your expected result.
If this post helps, please consider accept as solution to help other members find it more quickly.
Thank you! I used the second solution and it worked! I was wondering what I could do if I had two values I needed to create mode out of.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
8 | |
8 | |
7 |
User | Count |
---|---|
17 | |
13 | |
7 | |
6 | |
6 |