Forum Discussion

mediumlevel2024's avatar
mediumlevel2024
Frequent Visitor
2 years ago
Solved

Price Average per selected TopN

Hello everyone, I currently have the problem that I need the average price per selected TopN. This results in price duplication and the average does not recognize that the individual values should b...
  • Rupak_bi's avatar
    2 years ago

    Hi,

    Run the TopN function on some unique column.

    ØN price =
    VAR SelectedN = SELECTEDVALUE('Average N'[Average N])
    RETURN
    CALCULATE(
        AVERAGE(table[price]),
        TOPN(
            SelectedN,
            table,
            table[Article ID],
            ASC
        )
    )