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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
jaclynt8
Frequent Visitor

Calculating Mode

Hi, I am trying to calculate Mode from existing queries

Example: 

 

productprice
a1231.2
a2351.5
a1231.2
a1231.2
a1231.3
a1260.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:

productprice (mode)
a1231.2
a1260.3
a2351.5

Any suggestions would be incredibly helpful! Thanks! 

1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

@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.

Mahesh0016_1-1671770612772.png

 

***************************************** 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.

View solution in original post

3 REPLIES 3
wdx223_Daniel
Community Champion
Community Champion

wdx223_Daniel_0-1671777103798.png

 

Mahesh0016
Super User
Super User

@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.

Mahesh0016_1-1671770612772.png

 

***************************************** 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. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.