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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ase
Frequent Visitor

Turning Mode measure into a column

Good afternoon,

 

I have a trouble converting a measure that I created, into a column. Below is the ilustration of the issue: 

 

ase_0-1654613292052.png

 

I successfully created a measure that calculates the mode for each product - so it shows that the mode for Apples in 2021 is 5.96, but I need it as a column, as shown in the screenshot. 

 

The column should pick up the Mode amount for each product and sort it per year. Could somebody help me out with this? I read that a solution might be to create a virtual table from the Mode measure and then use lookup, but this sounds too complicated for someone with my skills. 

 

Thank you very much in advance!

 

Kind regards,

B

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @ase 

please try

=
VAR ItemYearTable =
    CALCULATETABLE (
        TableName,
        ALLEXCEPT ( TableName, TableName[Item], TableName[Yea] )
    )
VAR SummaryTable =
    SUMMARIZE (
        ItemYearTable,
        TableName[price per unit],
        "@cont", CALCULATE ( COUNTROWS ( TableName ) )
    )
VAR MaxCount =
    MAXX ( SummaryTable, [@count] )
RETURN
    MAXX ( FILTER ( SummaryTable, [@count] = MaxCount ), TableName[price per unit] )

View solution in original post

2 REPLIES 2
ase
Frequent Visitor

It works! Thank you very much for your time and effort!

tamerj1
Super User
Super User

Hi @ase 

please try

=
VAR ItemYearTable =
    CALCULATETABLE (
        TableName,
        ALLEXCEPT ( TableName, TableName[Item], TableName[Yea] )
    )
VAR SummaryTable =
    SUMMARIZE (
        ItemYearTable,
        TableName[price per unit],
        "@cont", CALCULATE ( COUNTROWS ( TableName ) )
    )
VAR MaxCount =
    MAXX ( SummaryTable, [@count] )
RETURN
    MAXX ( FILTER ( SummaryTable, [@count] = MaxCount ), TableName[price per unit] )

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.