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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors