cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
wilson_smyth
Helper V
Helper V

Only displaying data if one value in slicer is selected

I have a clustered bar chart displaying a value for each category, category in this case is manager.

I have a slicer on manager dimension.

I only want data to display in the chart if one manager is selected in the slicer. Ive tried hasonefilter & hasonevalue but it does not work.

 

 

 

% Holidays taken = if(HASONEFILTER(manager[MangerName]), SUMX(EmployeeHolidays, EmployeeHolidays[HolidaysTaken]) /SUMX(EmployeeHolidays,EmployeeHolidays[Holidays allowed]),blank())

 

 

Even if two managers are selected & hasOneFilter is FALSE, the chart still shows a column for each manager.

Is it possible to limit the chart to just one column and show nothing if multiple managers are selected?

Below link is a working example, demonstrating the issue.
Thanks for any expertise provided.

 

https://1drv.ms/u/s!AgldA0VQfPV9hNA0nmyWWnaHDd8sVw

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@wilson_smyth

 

try adding this calculated column in your "Employee Holidays" table

 

then use this in your chart instead of managerName from manager table

 

ManagerName = RELATED(manager[MangerName])

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@wilson_smyth

 

try adding this calculated column in your "Employee Holidays" table

 

then use this in your chart instead of managerName from manager table

 

ManagerName = RELATED(manager[MangerName])

Regards
Zubair

Please try my custom visuals

@wilson_smyth

 

File attached as well

 

Basically the formula is evaluated individually for each Axis/Row field
So for individual bar of the chart, the hasonefilter condition is TRUE although collectively it might not be TRUE

 

Thats why we could replace the Axiscolumn in the chart from ManagersTable[ManagerName] to EmployeeHolidays[ManagerName] and get the desired results

 

 

 

 


Regards
Zubair

Please try my custom visuals

Hi.


Thanks for the response.

That works well, thanks for the help!


Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors