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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
shrock777
Helper I
Helper I

Count and Sum of Balanced Orders and Tasks

Hello,

This might be very simple issue but it turns out complex for me.Below is the table. I am trying to calculate tasks and orders which are balanced(which means sum Order Count = 0). 

 

Count of distinct Orders = Calculate(distinctcount(order no))

 

Count of Orders in Balance =

Calculate(distinctcount(order no)),Filter(SUM(Order/Task Quantity = 0))

 

Count of Orders not in Balance =

Calculate(distinctcount(order no)),Filter(SUM(Order/Task Quantity <> 0))

 

Count of distinct Tasks =  Calculate(distinctcount(task order no))

 

Count of Tasks in Balance =

Calculate(distinctcount(task order no)),Filter(SUM(Order/Task Quantity = 0))

 

Count of Tasks not in Balance =

Calculate(distinctcount(task order no)),Filter(SUM(Order/Task Quantity <> 0))

 

Expected Result (KPI's)

  • Count of distinct Orders = 1
  • Count of Orders in Balance = 0
  • Count of Orders not in Balance = 1 
  • Count of distinct Tasks = 7
  • Count of Tasks in Balance = 5
  • Count of Tasks not in Balance = 2

I have Order No as slicer, For example if I select Order No 1350000-11 then it should display Count of Orders in Balance = 1 and Count of Orders not in Balance  = 0. Same applies for the date range, If I select 

Counts of Balanced Tasks is visualized in clustered bar chart and interactions should work as expected

@Greg_Deckler , @TomMartens 

 

Please help me with above issue. Thanks!! 

 

Order NoTask Order NoTask Completed DateOrder/Task Quantity
1350000 8/9/190
13500001350000-117/31/190
13500001350000-128/1/190
13500001350000-138/9/190
13500001350000-148/9/190
13500001350000-158/9/190
13500001350000-88/1/19-370
13500001350000-88/1/19-90
13500001350000-97/31/190
13500001350000-97/31/194
13500001350000-97/31/1995
7 REPLIES 7
TomMartens
Super User
Super User

Hey @shrock777 ,

 

I think that you have to re-think your solution.

 

The column chart in your report is only using a measure, it's not possible to make a measure the "origin" of an interaction between visuals, there is just one exception for this, one can use a measure as a "starting point" for a drillthrough or using the DETAILSROW function in combination with SSAS Tabular or Azure Analysis Services.

 

One approach could be to create a column inside your table called "balanced / not balanced", then use this column as the axis. As the measure you are using just filters for one of the two columns values there is just one column. For this reason, you can use the column to filter all your other visuals.

 

Hopefully, this provides some new ideas to tackle your challenge.

 

Regards,
Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Greg_Deckler
Community Champion
Community Champion

Perhaps:

Count of Orders in Balance =
  VAR __Table =
    GROUPBY(
      'Table',
      [Order No],
      "Balance",SUMX(CURRENTGROUP(),[Order/Task Quantity])
    )
RETURN
  COUNTROWS(FILTER(__Table,[Balance]=0))

The rest will be similar.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hello Greg,

 

Thanks for the reply. Counts are working perfectly but I have issue with interaction. When I click on the clustered bar chart(TNB) the TB and Count of Task should be 2 but they are not interacting. Below is the screenshot.

 

Thanks

WhatsApp Image 2020-05-09 at 11.29.39 AM.jpeg

 

Thanks

 

 

Hard to say, nothing in the formula as I wrote it is messing with context.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Greg, I am suprised too, because all the fields are from same table.  

 

Any help is appreciated @TomMartens , @Zubair_Muhammad @jdbuchanan71 @Greg_Deckler @Sean @MarcelBeug 

 

Thanks

hey @shrock777 ,

 

please upload the sample pbix to onedrive or dropbox and share the link.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hello @TomMartens ,

 

Thanks for the reply, below is the link for file.

 

https://filebin.net/7du6mez10dpfkdlw

Thanks

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.