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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
SteveIOW
Helper II
Helper II

Average of DistinctCount PCM

Dear all,

 

as you can see below I am trying to find the average of the last 6 months data.

The data is loaded in as individual users and the date the access a website. I am countinf the number that acess the site per month.

Distinct Users = DISTINCTCOUNT(UserID)

Then I am plotting this against a date from a Calendar table.

Now I want an average line.

I am using

AvUsersPCM = CALCULATE(AVERAGEX(SUMMARIZE('Calendar','Calendar'[YearMonthShort]), MeasuresTable[DistinctUsers]), ALLSELECTED('Calendar'[YearMonthShort]),'Calendar'[Last6Months] = "Y")
 
But it is way too low... the Last6Months flag gives the months to the right of the chart.

 

SteveIOW_0-1659103114258.png

Can anyone help please?

 

4 REPLIES 4
mh2587
Super User
Super User

Average Per Country = 
VAR _A =
    SUMMARIZE (
        'Table',
        'Table'[Country],
        'Table'[Product],
        "DisC", DISTINCTCOUNT ( 'Table'[Color] )
    )
RETURN
    AVERAGEX ( _A, [DisC] )
// Modify it with your scenario

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



 

@mh2587 Forgive me but is this not exactly the same as I ahve put above but without the ALLSELECTED?

 

Hi, @SteveIOW 

You can try to add dynamic reference lines to visuals with the Analytics pane in Power BI Desktop.

Please select visual->go to Visualization Area -> Analytics -> Average Line 

Use the Analytics pane in Power BI Desktop 

 

Best Regards,
Community Support Team _ Eason

Thank you - my issue is that I am trying to create an SPC that rferences only the last 6 months for mean and sigma lines. the rference line visuals will only provide mean and sigma lines for the whole displayed data. I need it to display the lines across the whole data but using only the last 6 months in the calculation.

any ideas?

 

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.