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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
matemusic
Advocate III
Advocate III

Filter with measurement

Hi Everyone, 

 

I hope you will be aple to help with the following challenge.

 

In data model I have a table with next columns: date, product, sales and goal. In table there are 5 products.

 

For selected period in report I want to count products, which had bigger sales comparing to goal and products, which had smaller sales comparing to goal.

 

So I created two measures:

 

Count of failed products = 
var tab = SUMMARIZE(Table1;Table1[Product];"Sales vs Goal";sum(Table1[Sales])-sum(Table1[Goal]))
var coun = COUNTAX(filter(tab;[Sales vs Goal]<0);Table1[Product])
return coun
Count of succeded products = var tab = SUMMARIZE(Table1;Table1[Product];"Sales vs Goal";sum(Table1[Sales])-sum(Table1[Goal]))
var coun = COUNTAX(filter(tab;[Sales vs Goal]>0);Table1[Product])
return coun

It worked fine:

 sample 1.png

 

Even if I filter by date:

sample 2.png

 

But, then I want to filter back: If i clik on failed products, i want to tho sales and goal just for failed products.

sample 3.png

 

I understand, this cant work. But maybe there is a way? I could do it with with dummy table, but my original data model is too huge, beacuese it takes to long to calculate.

 

My two measures knows, which products are failed or succeded, but how can I this list of products bring to barchart?

 

This problem has charged me quite a while, so I'll be very grateful for your help.
All the best, matemusic

 

 

4 REPLIES 4
Anonymous
Not applicable

Hi @matemusic,

 

I build a sample table with your measure, but I can't click on pie chart, can you share me some detail info about this or provide a sample file?

 

Capture.PNG

 

Capture2.PNG

 

In my sample, the product all displayed as failed.

 

Regards,

Xiaoxin Sheng

Hey, I will create demo file with working solution and share it with you 😉

Anonymous
Not applicable

I feel as if this *is* possible, but you are going to have to use a "disconnected slicer" (aka, "disconnected table") and some tricky DAX.  I would look through some P3 archives and see if you are inspired 🙂   http://www.powerpivotpro.com/tag/disconnected-slicers/

 

Like, a table that JUST has 2 rows "Failed" and "Succeeded".  Then measures like...

MySuperMeasure = IF ( [Current Success or Failure Table Value] = "Failed", [FailureMeasure], [SuccessMeasure])

 

Use MySuperMeasure AND the field from your 2 row rable in your visuals?

Hey, thanks for your help, but it didnt solve my problem. Anyway, with today new Power bi release, I can finally get excepted result .

I used new Top N filter feature and one easy trick 🙂   

 

I will try to create demo pbix file and share it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.