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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
IwanVB
Frequent Visitor

Always show certain data in a Graph despite slicer selection

I have the situation where in one table both Savings and Targets are stored (data structure below). I want to have a graph with on the x-axis the years, and on the y-axis the Savings (bar) Target (line).


The solution I have in mind is:

- Two slicers: one for "BG", one for "Plant"

- The result (table or graph)  should always display the target records despite the value of the slicer. 

 

Data Structure

BG        | Plant    | Saving | Target | year

------------------------------------

A1        |  B1       |   200   |     0     | 2023

A 2       |  B2       |   200   |     0     | 2024

etc.

Target  |  Target  |   0      |    105   | 2023

Target  |  Target  |   0      |    205   | 2024

 

What I did already

 

First, for the slicers I made a separate table using DAX storing the BG and Plant. This table (called "Table1") has no relation with my main table 

category list =
SELECTCOLUMNS(
    Table1,
    "BG",Table1[BG]"Plant",Table1[Plant]
)

Second: Added a measure to my main table. If the value for the plant record is "Target" the 1 otherwise 0. This this for both the "Plant" and "BG" field. 

is filter_plant =
if(
    MIN(Table1[Plant]) = "Target" ,
    1,
    if (
        MIN(Table1[Plant]IN VALUES('category list'[Plant]) ,
        1,
        0
    )

Result
In the slicer (via category list), "BG=A2", the the table looks like below. Which is acutally great, since now I can filter on "filter_plant=1" and "filter_bg=1" and the table will show the perfect and desired result

BG        | Plant    | Saving | Target | year | filter_plant | filter_bg

--------------------------------------------------------------------

A1        |  B1       |   200   |     0     | 2023  |   0             |  0

A 2       |  B2       |   200   |     0     | 2024  |   1             |  1

etc.

Target  |  Target  |   0      |    105   | 2023 |    1             |  1

Target  |  Target  |   0      |    205   | 2024 |   1             |  1


The problem
When i create a "line and clustered column chart" out of the table above, the result is good when no data is selected via the slicer. Once selected via the slicer, the graph is empty. How to solve?
1 REPLY 1
amitchandak
Super User
Super User

@IwanVB , Try like

 

Countrows(filter(Table1, Table1[Plant] IN VALUES('category list'[Plant]) || Table1[Plant] = "Target"))+0

 

 

or

 

Switch(True(),
max(Table1[Plant]) IN VALUES('category list'[Plant]) || max(Table1[Plant]) = "Target", 1,0)+0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors