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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
amaaiia
Super User
Super User

Force blanks to appear in bar chart but not in slicer

Hi,

I have a a table with fields: 

date algorithmName machineName machineType value
2025-05-01 alg1 m1 t1 45
2025-05-01 alg1 m2 t1 20
2025-05-01 alg2 m3 t2 65
2025-05-01 alg3 m4   3
2025-05-01 alg4 m5   12

 

I have a line and clustered column chart with date filed in X axis. I want to set alg1 and alg2 values of algorithmName column as bars and alg2 and alg3 values as lines. sum(value) will be the measure.

 

There will be a slicer for machineType column, so the user can select t1 or t2 (not blank). However, I need alg3 and alg4 values to always be displayed as lines, that is, when mahicneType is blanks, always has to be displayed. So, the user filters t1 or t2 just to filter values in bars, not in lines.

 

How can this be done? I've been doing some testing but I'm not sure how to do it.

1 ACCEPTED SOLUTION
mdaatifraza5556
Solution Specialist
Solution Specialist

Hi @amaaiia 

Can you please try the steps below:

 

Step 1. Create two measres.

 

------ First measures

BarValues =
CALCULATE(
    SUM('Table'[value]),
    'Table'[algorithmName] IN {"alg1", "alg2"}
)
 
 
 
--- 2nd measures
 
LineValues =
CALCULATE(
    SUM('Table'[value]),
    'Table'[algorithmName] IN {"alg3", "alg4"},
    REMOVEFILTERS('Table'[machineType])
)
2. Steps
 
-- x-axis-- date
-- column y axis - BarValues
-- line y axis - LineValues
 
3. Steps
 
When you use the slicer, then from the filter pane select only t1 and t2
Screenshot 2025-05-08 142922.png

 

 
 
If this answers your questions, kindly accept it as a solution and give kudos

View solution in original post

1 REPLY 1
mdaatifraza5556
Solution Specialist
Solution Specialist

Hi @amaaiia 

Can you please try the steps below:

 

Step 1. Create two measres.

 

------ First measures

BarValues =
CALCULATE(
    SUM('Table'[value]),
    'Table'[algorithmName] IN {"alg1", "alg2"}
)
 
 
 
--- 2nd measures
 
LineValues =
CALCULATE(
    SUM('Table'[value]),
    'Table'[algorithmName] IN {"alg3", "alg4"},
    REMOVEFILTERS('Table'[machineType])
)
2. Steps
 
-- x-axis-- date
-- column y axis - BarValues
-- line y axis - LineValues
 
3. Steps
 
When you use the slicer, then from the filter pane select only t1 and t2
Screenshot 2025-05-08 142922.png

 

 
 
If this answers your questions, kindly accept it as a solution and give kudos

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.