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
Anonymous
Not applicable

Average line not to be affected by x-axis values/categories

Hi everyone!

 

I have a bar chart with Year-Month on the x-axis and my y-axis values = average tasks per project.

 

This is an example of my data:

yearMonth Project ID Total Tasks Measure 
20214712481111
20214713601010
202147256722
202157124011
20215712541111
202157199088
202157232211
202157234211
202157235611
202157235711
202157291011
202157295711
202167128111
202167218855
20216722251313
202167235144
202167235266
202167296933

 

So I have the bar chart that represents "Total tasks per project over Time". Now I would like to add a horisontal line representing Average tasks per project over ALL time, but everything I tried (ALL, ALLEXCEPT, FILTER etc) ended up looking like this:

Analyst1991_0-1625235452577.png

I need the orange line to not be affected by the month, but rather Total tasks divided by Total projects divided by 3 months.

The average line made available by the analytics pane gives me the correct value (5.33 in this case), but I need to visualise that value on a Card, and I'm doing something wrong...

Help would be much appreciated!

 

7 REPLIES 7
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

How do you get 8, 3, 5 in your visual? Do you choose a specific project? I don't understand your logic very well. Can you explain more information and details? So we can help you soon.

 

Best Regards

Janey Guo

 

 

Anonymous
Not applicable

Hi @v-janeyg-msft I simply added the "total tasks" field to the visual's column values and changed the summarization to Average (8, 5 and 3 were rounded up):

Analyst1991_0-1625485639480.png

 

Hi, @Anonymous 

 

There is no context in the card visual, so you need to create a measure using summarize table.

Like this:

Measure =
AVERAGEX (
    SUMMARIZE (
        ALL ( 'Table' ),
        [yearMonth ],
        "a",
            AVERAGEX (
                FILTER ( ALL ( 'Table' ), [yearMonth ] = SELECTEDVALUE ( 'Table'[yearMonth ] ) ),
                [Total Tasks ]
            )
    ),
    [a]
)

vjaneygmsft_0-1625538664256.png

 

Best Regards

Janey Guo

 

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

 

Anonymous
Not applicable

Thank you for your response @v-janeyg-msft

The measure you provided doesn't change when I change my date filter?

FYI I have a calender table that filters this table by Project Completed date.

Hi, @Anonymous 

 

Try to delete all or use allselected instead of all in the formula.

 

Best Regards

Janey Guo

 

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

Anonymous
Not applicable

@amitchandak unfortunately not 😞

amitchandak
Super User
Super User

@Anonymous , Try if this measure can work

calculate(averageX(values(Table[Yearmonth]),[Measure]), allselected(Table[Yearmonth]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

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