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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Average per month in a table

Hello

 

My problem is to have a average per month in a table, example:

 

 

 Udklip.PNG

 

It has to look like:

 

Udklip2.PNG

 

Anyone that could help me with a dax formula? 

I've tried Averagex, but I wouldn't work.

 

Please Help 🙂 

9 REPLIES 9
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

You may create a measure like below:

Measure =
AVERAGEX (
    FILTER (
        ALL ( Table1 ),
        MONTH ( Table1[Created Date] ) = MONTH ( MAX ( Table1[Created Date] ) )
    ),
    Table1[Cost]
)

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello Cherie

 

Thanks for your quick answer.

But it doesn't seem right - look below:

 

 

Udklip.PNGUdklip2.PNG

 

What do I do wrong?

 

Please help 🙂 

 

Hi @Anonymous

 

Could you show me the data or share your .pbix file?Below is my sample data.You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Cherie

 

It got it to work now - it was a data error.

Udklip4(1).PNG

 

But I now have a new issue - I have to see it per item. 

So in this I need 973202 item to calculate measure like above mentioned (for March it has to be 8,00 not 5,36)

When I click on the overview table at 973202, it still counts all the lines with in the measure, it has to be per item, hope you understand? How do i do?

 

 

Udklip4(2).PNG

 

Hope you can help me 🙂 

Hi @Anonymous

 

It seems the cost is a measure.Could you provide the formula of the cost measure?It would be better if you could paste the data here instead of the screenshot.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Cherie

 

The cost measure (its a new column) comes here:

 

Cost = Ark1[Line Amount MST]/Ark1[Purchased Quantity]
 
Hope you can help me 🙂 
 

Hi @Anonymous 

 

Could you tell me if your problem has been solved? If it is,kindly mark the helpful answer as a solution and welcome to share your own solution. More people will benefit from here. If not, please share more details for us so that we could help further on it.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Cherie

 

The problem has not been solved - i need the average cost pr. item and not for the hole table - can you help with that? 

 

Regards Elena

Hi @Anonymous 

 

Try below measure:

Measure 3 =
AVERAGEX (
    FILTER (
        ALLSELECTED ( Ark1 ),
        MONTH ( Ark1[Created Date] ) = MONTH ( MAX ( Ark1[Created Date] ) )
    ),
    [Cost]
)

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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