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

Not be grouped by

Hey! I got a bar chart, x-axis is list of brands, y-axis measure. Looks like this:

Gleb_0-1652277685890.png

(can't show x-acis due to company agreement). I need a measure that will be an average value of y-axis measure by x-axis category. I can calculate this measure: 

Average sat =
AVERAGEX(
    KEEPFILTERS(VALUES('Both'[Brand])),
    CALCULATE([% satisfaction top 2]))
But when I put it as a line on barchart it don't shows me what I need, I need a straight line.
 
1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hi:

Can you try a Line & Clustered chart, using the overall measure as seconday Y? I'll paste image for more clarity. My example is on profit margin %, but can be done for your overall SAT measure. I hope this helps..

Whitewater100_0-1652285951793.png

Measure for flat line:

Profit Margin% ALL =
var profit = CALCULATE(SUM(Data[Profit]),ALL(Data))
var sales = CALCULATE(SUM(Data[Sales]),ALL(Data))
return
DIVIDE(profit,sales)

View solution in original post

6 REPLIES 6
SpartaBI
Community Champion
Community Champion

@Anonymous just add your measure as a constant line in the analytics tab of the visual formatting :

SpartaBI_0-1652352139837.png

 


2022-05-09 21_46_30-Auto sign in click on _Sign-in_ if button appears ... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png  SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

Anonymous
Not applicable

The answer is correct, very cool. But I should use not constant line, but average line, thanks, I didn't know about these feature.

Whitewater100
Solution Sage
Solution Sage

Hi:

Can you try a Line & Clustered chart, using the overall measure as seconday Y? I'll paste image for more clarity. My example is on profit margin %, but can be done for your overall SAT measure. I hope this helps..

Whitewater100_0-1652285951793.png

Measure for flat line:

Profit Margin% ALL =
var profit = CALCULATE(SUM(Data[Profit]),ALL(Data))
var sales = CALCULATE(SUM(Data[Sales]),ALL(Data))
return
DIVIDE(profit,sales)
Anonymous
Not applicable

I won't work because let's say your sales in my case is a measure, not a column

Hi:

Can you provide example data (and image of key tables in your data model)as it should be possible to create a measure showing the values you want as a straight line? 

Thanks

Anonymous
Not applicable

Table: Both;
Columns: Brand, Person_ID, Question, Answer, answer_code, Type
Measure: 

% satisfaction  =
var t1b = CALCULATE(distinctcount('Both'[person_id]), or(Both[answer_code] = "5", Both[answer_code] = "4"), Both[Type] = "Satisfaction")
var total_cnt = calculate(distinctCOUNT(Both[person_id]), Both[Type] = "Satisfaction")
return t1b/total_cnt

So, it just counts the % of positive answers, and I show it as % per brand in a bar chart(x-axis - brand, y-axis - satisfaction measure. How to show average satisfaction by brand on the same bar chart as line?

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.