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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Syndicate_Admin
Administrator
Administrator

Create new column based on a calculated one

Good

I am trying to create a column that gives me the most repeated value for a certain value. For this I have made a Count column, where I calculate how much the value is repeated.

I need to fill in the column name + repeated, with the name that is repeated the most for each code.

Enrike_1-1669648614123.png

Thank you!

2 ACCEPTED SOLUTIONS

Hi @Syndicate_Admin ,

try this column

mangaus1111_0-1669664439056.png

Column = 
VAR _MaxCount =
MAXX(
   FILTER(
       'Table',
       'Table'[Code] = EARLIER('Table'[Code])
      ),
'Table'[Count]
)
RETURN
SELECTCOLUMNS(
FILTER(
    'Table',
    'Table'[Code] = EARLIER('Table'[Code]) && 'Table'[Count]  = _MaxCount
),
"Nombre",[Nombre]
)

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @Syndicate_Admin ,

 

You can try this method:

Name + repeated =
VAR _max =
    CALCULATE ( MAX ( 'Table'[Count] ), ALLEXCEPT ( 'Table', 'Table'[Code] ) )
RETURN
    CALCULATE ( MAX ( 'Table'[Number] ), FILTER ( 'Table', 'Table'[Count] = _max ) )

The result is:

vyinliwmsft_0-1669701226081.png

Hope this helps you.

Here is my PBIX file.

 

Best Regards,

Community Support Team _Yinliw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
mangaus1111
Solution Sage
Solution Sage

Hi @Syndicate_Admin ,

try with this calculated column

mangaus1111_0-1669650525666.png

Column = 
VAR _MaxCount = MAX('Table'[Count])
RETURN
SELECTCOLUMNS(
FILTER(
    'Table',
     'Table'[Count]  = _MaxCount
),
"Nombre",[Nombre]
)

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Syndicate_Admin , The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.


Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Good

I have prepared a table to try to explain it. I want the column "name + repeated" to take the value of "Name" that is repeated more times for a code.

That is, for Code MI-0876 that has three entries, put the value of Peter.

CodeCountNumberName + repeated
MI-087610LouisPedro
MI-087620PedroPedro
MI-08765AntonioSedro
MU-0981SofiaSofia
MU-07814AlejandraAlejandra

thanks and greetings

Hi @Syndicate_Admin ,

 

You can try this method:

Name + repeated =
VAR _max =
    CALCULATE ( MAX ( 'Table'[Count] ), ALLEXCEPT ( 'Table', 'Table'[Code] ) )
RETURN
    CALCULATE ( MAX ( 'Table'[Number] ), FILTER ( 'Table', 'Table'[Count] = _max ) )

The result is:

vyinliwmsft_0-1669701226081.png

Hope this helps you.

Here is my PBIX file.

 

Best Regards,

Community Support Team _Yinliw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Syndicate_Admin ,

try this column

mangaus1111_0-1669664439056.png

Column = 
VAR _MaxCount =
MAXX(
   FILTER(
       'Table',
       'Table'[Code] = EARLIER('Table'[Code])
      ),
'Table'[Count]
)
RETURN
SELECTCOLUMNS(
FILTER(
    'Table',
    'Table'[Code] = EARLIER('Table'[Code]) && 'Table'[Count]  = _MaxCount
),
"Nombre",[Nombre]
)

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.