Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello everyone,
I need your help for the following problem :
At the filter level, I filter on a category and at the graph level, I display all categories except the filtered one. by using the following measurement :
mesure = CALCULATE([Σ of commitments], ALL('Category Segment'), NOT('Category Segment'[Category label]) IN FILTERS ('Category Segment'[Category label]))
Now I need to display only the categories of the suppliers in the filtered category
For example :
supplier 1 : C1 , C2
supplier 2 : C1, C3
supplier 3 : C4, C5
I filter on C1, what I want to display is : C2, C3
thanks for your help
Solved! Go to Solution.
Hi @KLAH96 ,
Try the following formula:
sum =
var FilteredID =
CALCULATETABLE(
VALUES(commitment[id_suppliers]),
ALLSELECTED(commitment)
)
var AllID =
CALCULATETABLE(
VALUES(commitment[id_suppliers]),
ALL(commitment)
)
return
CALCULATE(
[Σ of commitments],
NOT('Category Segment'[Category label]) IN FILTERS ('Category Segment'[Category label]),
INTERSECT( AllID, FilteredID )
)
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.
@KLAH96 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
hello
Thank you for these tips.
we can imagine that I have 3 tables :
table 1 : liste of suppliers
| Suppliers | id_suppliers |
| S1 | 1 |
| S2 | 2 |
| S3 | 3 |
table 2 : commitment
| id_suppliers | category | commitment |
| 1 | C1 | 100 |
| 1 | C2 | 500 |
| 2 | C1 | 250 |
| 2 | C3 | 400 |
| 3 | C4 | 500 |
| 3 | C5 | 600 |
table 3 : category segment
| category | Category label |
| C1 | cat 1 |
| C2 | cat 2 |
| C3 | cat 3 |
| C4 | cat 4 |
| C5 | cat 5 |
if I filter on the category label 'cat 1' and display the list of categories except the filtered one, i obtain :
sum = CALCULATE([Σ of commitments], ALL('Category Segment'), NOT('Category Segment'[Category label]) IN FILTERS ('Category Segment'[Category label]))
results :
| category | sum |
| C2 | 500 |
| C3 | 400 |
| C4 | 500 |
| C5 | 600 |
But what I really want to obtain is only
| category | sum |
| C2 | 500 |
| C3 | 400 |
only the categories of suppliers in common with the "C1".
thanks
Hi @KLAH96 ,
Try the following formula:
sum =
var FilteredID =
CALCULATETABLE(
VALUES(commitment[id_suppliers]),
ALLSELECTED(commitment)
)
var AllID =
CALCULATETABLE(
VALUES(commitment[id_suppliers]),
ALL(commitment)
)
return
CALCULATE(
[Σ of commitments],
NOT('Category Segment'[Category label]) IN FILTERS ('Category Segment'[Category label]),
INTERSECT( AllID, FilteredID )
)
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.
Thanks a lot.
it works, very well!!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |