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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
PBI5851
Helper V
Helper V

Assistance with a bar chart

Hello,

 I have two tables as  below. 

MainTable

OrdIDOrdDateSalesPOrdStatus
A1235/1/2022StevePending
A1245/2/2022JackieShipped
A1255/3/2022SteveComplete
A1265/4/2022MaryComplete
A1275/5/2022JohnComplete

 

outreach table

OTIDOrdIDOutTypeOutDate
O123A125Phone5/4/2022
O124A125Virtual5/5/2022
O125A125Virtual5/6/2022
O126A125Virtual5/7/2022
O127A125Phone5/8/2022
O128A125F2F5/9/2022
O129A125F2F5/10/2022
O130A125Phone5/11/2022
O131A126F2F5/4/2022
O132A126F2F5/4/2022
O133A126Phone5/8/2022
O134A126Phone5/9/2022
O135A126Virtual5/5/2022
O136A127Virtual5/6/2022
O137A127Virtual5/7/2022
O138A127Virtual5/8/2022
O139A127Virtual5/9/2022

 

Main is joined to Outreach by OrdID.  End goal is to display a chart with how many orders have 0, 1, 2, 3 , 4 etc outreach attempts. 

So, the x-axis will be 0,1,2,3,4

The y Axis would be 1, 0 ,0 ,0 ,1, 1, 0,0,0 (1 ord had 0 outreach, 0 ord have 2 outreach...., 1 ord had 4 outreach etc). 

 

In order to accomplish this, i used a summarized table and was able to get the numbers, but the ones with 0 outreaches, dont show up.  , since the join to main table missed the missing id in the summarized table. 

 

Any recommendation on how to resolve the sumarized table or any other solution on achieving the goal. 

 

Thank you.

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @PBI5851 ,

 

Please create the table and measure.

 

Table = GENERATESERIES ( 0, COUNTROWS ( 'outreach table' ) )
Measure = 
VAR tab =
    SUMMARIZE (
        MainTable,
        MainTable[OrdID],
        "CountNum", COUNTROWS ( 'outreach table' ) + 0
    )
RETURN
    COUNTROWS ( FILTER ( tab, [CountNum] = MAX ( 'Table'[Value] ) ) )

vkkfmsft_0-1657252076039.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

1 REPLY 1
v-kkf-msft
Community Support
Community Support

Hi @PBI5851 ,

 

Please create the table and measure.

 

Table = GENERATESERIES ( 0, COUNTROWS ( 'outreach table' ) )
Measure = 
VAR tab =
    SUMMARIZE (
        MainTable,
        MainTable[OrdID],
        "CountNum", COUNTROWS ( 'outreach table' ) + 0
    )
RETURN
    COUNTROWS ( FILTER ( tab, [CountNum] = MAX ( 'Table'[Value] ) ) )

vkkfmsft_0-1657252076039.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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