This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi guys, I'm new in PBI, I'm looking for ways to have a condition in filter. I have these slicers with type: sedan, hatchback, truck and I have 2 line chart:
- Hatchback and Sedan
- Truck
Now, I have the table car type as global filter:
They have relationship on car type hence when I select any value in the slicer, it will affect the line charts. Now my goal is that if I only select Truck, the hatchback and sedan linechart should not be affected:
and if I select Sedan and Truck, both the line chart should be affected:
This is the sample data:
Car type:
| CarType |
| Truck |
| Sedan |
| Hatchback |
hatchback and Sedan:
| Type | Id | ExtractedDate_YearMonth | SumDuration |
| Sedan | ORDER12335 | 01/10/2021 | 80.1 |
| Sedan | ORDER56723 | 01/01/2021 | 81 |
| Sedan | ORDER75231 | 01/11/2021 | 22 |
| Hatchback | ORDER16843 | 01/08/2021 | 13 |
Truck:
| Type | Id | ExtractedDate_YearMonth | SumDuration |
| Truck | ORDER11111 | 01/01/2021 | 12.1 |
| Truck | ORDER33333 | 01/02/2021 | 99 |
| Truck | ORDER33331 | 01/03/2021 | 17 |
I have other linecharts connected to the car type and I want to just use this car type as global filter. Do you guys have an tips or tricks for me to utilize the slicer?
Thanks in advance!
Solved! Go to Solution.
Hi @Anonymous ,
You can create two measures separately. When the slicer selects Truck, the display related to Truck is displayed. When the slicer selects Truck and Sedan, the display related to Truck and Sedan is displayed. I don't know what the result of your specific condition judgment is. To define the rules, you can replace the judgment result in the following function:
Measure =
var _select=SELECTCOLUMNS('Car type',"1",'Car type'[CarType])
return
IF(
"Truck" in _select&& NOT("Sedan" in _select),
SUM('hatchback and Sedan'[SumDuration]),0
)Measure 2 =
var _select=SELECTCOLUMNS('Car type',"1",'Car type'[CarType])
return
IF(
"Truck" in _select&& "Sedan" in _select,
SUM('Truck'[SumDuration]),0
)
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You can create two measures separately. When the slicer selects Truck, the display related to Truck is displayed. When the slicer selects Truck and Sedan, the display related to Truck and Sedan is displayed. I don't know what the result of your specific condition judgment is. To define the rules, you can replace the judgment result in the following function:
Measure =
var _select=SELECTCOLUMNS('Car type',"1",'Car type'[CarType])
return
IF(
"Truck" in _select&& NOT("Sedan" in _select),
SUM('hatchback and Sedan'[SumDuration]),0
)Measure 2 =
var _select=SELECTCOLUMNS('Car type',"1",'Car type'[CarType])
return
IF(
"Truck" in _select&& "Sedan" in _select,
SUM('Truck'[SumDuration]),0
)
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you
@Anonymous 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.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 29 | |
| 27 | |
| 25 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 53 | |
| 47 | |
| 22 | |
| 19 | |
| 18 |