cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## DAX (Average of a card visualisation)

Hi All,

The card above shows the sum.

I have calculated that way so that I can get excess buffered stock of each week in a bar chart.

But now, I need the average of that when I select a card visualisation.

How can I take the average of a measure?

Any help would be appreciated!

Thank you!

1 ACCEPTED SOLUTION
Continued Contributor

@Anonymous

Suppose you have a Week_No or Week_Name that you use on your barchart with the measure.
You can iterate on each of the week, calculate the measure then take the average of each number.

That's what AVERAGEX will be able to do :

``````Avg_Week =
AVERAGEX(
VALUES( 'Table'[Week_No] ),
[Your_Initial_Measure]
)``````

Hope this helps.

5 REPLIES 5
Continued Contributor

@Anonymous

Suppose you have a Week_No or Week_Name that you use on your barchart with the measure.
You can iterate on each of the week, calculate the measure then take the average of each number.

That's what AVERAGEX will be able to do :

``````Avg_Week =
AVERAGEX(
VALUES( 'Table'[Week_No] ),
[Your_Initial_Measure]
)``````

Hope this helps.

Anonymous
Not applicable

Thanks a lot! @m3tr01d

Super User

Hi @Anonymous

Your question is unclear for me, so can you share the code you used to create the [excess buffered stock] measure?

Resolver I

This is my first time attempting a reply so apologies if I've misunderstood the question...

If you go to the "Fields" area of the Visualisation pane and right click on the "Excess Buffered Stock field" you should see options for "Sum", "Average", "Minimum" etc. If so simply select the "Average option".

If not, that's probably because the field is set to "Don't Summarize". To change this go to "Data view" (left hand side), select the relevant column in the table and then under "Column Tools" change "Summarization" to "Sum" (average migth work as well). Then just go go through the steps above and it should work.

Matt

Anonymous
Not applicable

Thank you for your response @Coriel-11

But I just want to know if I can take an average of a particular measure.

Announcements

#### Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors