The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am looking if it's possible to add a total order count by project manager into a stacked bar chart. The stacked bar chart is providing averages for different segments. I've tried several calculated fields to try to concatenate a total order count with a project manager but I am only getting a total count of 1.
Hi,Fowmy ,thanks for your concern about this issue.
Your answer is excellent!
Hello,@mkohler281 .I am glad to help you.
Like this?
Note that when you use horizontal bar stacking charts, the Y-axis field has to be placed with a static dimension field, which means that the field data on the dimension is not able to change according to the computational environment and it cannot be affected by the slicer. (Calculated columns must be placed, not measures)
The calculated column I created:
No_avg =
VAR _count =
CALCULATE (
COUNT ( 'po_header'[PO Number] ),
ALLEXCEPT ( po_header, 'po_header'[Project Manager] )
)
VAR _numSegement =
CALCULATE ( DISTINCTCOUNT ( 'po_header'[Segment] ), ALL ( po_header ) )
RETURN
FORMAT ( DIVIDE ( _count, _numSegement, 0 ), "0.00" )
Result =
"(" & [No_avg] & ") " & 'po_header'[Project Manager]
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is excellent but I have three X-Axis values, and no legend, how would this work in that senario?
Hi,@mkohler281 .Thank you for your reply.
If the three aggregated values that you have placed in the X-axis are measures,
then you will have to create calculated columns to be placed in the Y-axis of the bar chart as categorized fields.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian
@mkohler281
What's your DAX formula to get the count?
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group