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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
baneworth
Helper III
Helper III

Problems with AVG line on chart

Following Issue:

I am collecting issues found on a product. X axis shows the product ID and the y axis shows the finding count.

 

chart qcbs 1.jpg

 

Now i need to add a avg line to the chart, where i already have the formula (Fact_QCBS[Serial Number] is the product ID)

avg rating bi.jpg

 

After i add the avg line to the chart it obviously just lays another line above the exisiting one, due to the relation with product ID.

 

How can i make a avg line that just shows the plain value as a line, so that it shows as below?

Filtering in the above avg_rating dax?

chart qcbs 1.jpg

 

Best regards

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Thanks for the solution dk_dk  offered,and i want to offer some more information for user to refer to.

hello @baneworth ,based on your description, you can try the following code.

 

AVG_Rating =
VAR a =
    SUMX ( ALLSELECTED ( Fact_QCBS[Serial Numner] ), [Total Rating] )
VAR b =
    CALCULATE (
        DISTINCTCOUNT ( Fact_QCBS[Serial Numner] ),
        ALLSELECTED ( Fact_QCBS )
    )
RETURN
    DIVIDE ( a, b ) + 0

If the solution cannot meet your requirement, can you provide some sample data so that can provide more suggestion for you.

 

Best Regards!

Yolo Zhu

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

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

Thanks for the solution dk_dk  offered,and i want to offer some more information for user to refer to.

hello @baneworth ,based on your description, you can try the following code.

 

AVG_Rating =
VAR a =
    SUMX ( ALLSELECTED ( Fact_QCBS[Serial Numner] ), [Total Rating] )
VAR b =
    CALCULATE (
        DISTINCTCOUNT ( Fact_QCBS[Serial Numner] ),
        ALLSELECTED ( Fact_QCBS )
    )
RETURN
    DIVIDE ( a, b ) + 0

If the solution cannot meet your requirement, can you provide some sample data so that can provide more suggestion for you.

 

Best Regards!

Yolo Zhu

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

It worked 🙂

thanks a lot

dk_dk
Super User
Super User

Hi @baneworth 

You could try the folowing change to your formula:

AVG_Rating = [Total rating]/DISTINCTCOUNT(ALL(Fact_QCBS[Serial Number]))+0
You may have to also modify your Total rating measure.






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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