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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Measure that sums up a column based on the average value grouped by category

Pretty straight forward. Any help is appreciated. Example below:

 

CategoryValue
a10
a10
b20
b20

 

Measure's results: 30

Because a + b = 10 + 20 = 30

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

you can use

SUMX (

SUMMARIZE (

TableName, 

TableName[Category],

"@Average", AVERAGE ( TableName[Value] )

),

[@Average]
)

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

the associated output of the measure would be this:

 

Category2022.242022.252022.26
BCP-06001
BCP-08000

 

Counts if the category changes over time. The first screen shot from the previous reply is simply a count of the category.

tamerj1
Super User
Super User

Hi @Anonymous 

you can use

SUMX (

SUMMARIZE (

TableName, 

TableName[Category],

"@Average", AVERAGE ( TableName[Value] )

),

[@Average]
)

Anonymous
Not applicable

One more question: How would I convert this into a COUNTX?

 

This worked beautifully. Thanks so much by the way.

Hi @Anonymous 

what do you want to count exactly?

Anonymous
Not applicable

I want to count the averages grouped by category

@Anonymous 

The number of averages would be the number of categories. what is different is the distinct number of averages. In this case you may try

=
COUNTROWS (
    DISTINCT (
        SELECTCOLUMNS (
            SUMMARIZE (
                TableName,
                TableName[Category],
                "@Average", AVERAGE ( TableName[Value] )
            ),
            "@@Average", [@Average]
        )
    )
)
Anonymous
Not applicable

I would think that would work and I have come up with something similar. What I really need is the count of categories that change over a time period (see below). There would only be a count of 1 for the below snippet for 2022.26 column.

And then display them as a bar chart with x-axis being yyyy.ww

 

work22_0-1660852079472.png

 

sorry but still not able to pick up the idea. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors