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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Diptarup
Helper II
Helper II

how to derive a count from a measure

I have written a measures by name Baseline Average and the value for each row item I am getting while putting them in a table is given below.

 

ID                      Baseline Average

A1.B1                  1

A1.B2                   0.58

A1.B3                   0.0

--------------------------

Total Average       0.55

---------------------------

However the total Average displayed is incorrect

 

What I intend to do is to sumup the measure "Baseline Average" and then divide it with ID#. 

Calculation would be 1.58/3 = 0.53.

 

How do I count the ID from the above table or there is any other way of achieving the average as 0.53. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Diptarup 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1709016277441.png

 

Create a measure. Calculate Baseline Average.

 

Baseline Average = 
VAR _COUNT = 
CALCULATE(
    COUNTROWS('Table'), 
    FILTER(
        ALL('Table'), 
        'Table'[ID] = MAX('Table'[ID])
    )
)
VAR _VALUES = 
CALCULATE(
    SUM('Table'[VALUES]), 
    FILTER(
        ALL('Table'), 
        'Table'[ID] = MAX('Table'[ID])
    )
)
RETURN DIVIDE(_VALUES, _COUNT)

 

vnuocmsft_1-1709016489112.png

 

You can try creating the following measure.

 

Average of Baseline Average = 
VAR ID_COUNT = DISTINCTCOUNT('Table'[ID])
RETURN 
SUMX(VALUES('Table'[ID]), [Baseline Average]) / ID_COUNT

 

Here is the result.

vnuocmsft_2-1709016565127.png

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Diptarup 

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1709016277441.png

 

Create a measure. Calculate Baseline Average.

 

Baseline Average = 
VAR _COUNT = 
CALCULATE(
    COUNTROWS('Table'), 
    FILTER(
        ALL('Table'), 
        'Table'[ID] = MAX('Table'[ID])
    )
)
VAR _VALUES = 
CALCULATE(
    SUM('Table'[VALUES]), 
    FILTER(
        ALL('Table'), 
        'Table'[ID] = MAX('Table'[ID])
    )
)
RETURN DIVIDE(_VALUES, _COUNT)

 

vnuocmsft_1-1709016489112.png

 

You can try creating the following measure.

 

Average of Baseline Average = 
VAR ID_COUNT = DISTINCTCOUNT('Table'[ID])
RETURN 
SUMX(VALUES('Table'[ID]), [Baseline Average]) / ID_COUNT

 

Here is the result.

vnuocmsft_2-1709016565127.png

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

PijushRoy
Super User
Super User

Hi @Diptarup 

Can you please try below DAX,

 

Measure = DIVIDE(SUM(Yourtable[Column]),COUNT(Yourtable[ID]))

 

 

If not work, please share sample data.


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors