cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simrantuli
Responsive Resident
Responsive Resident

Slicer selection not working for line

Hi All,

I have 3 tables in my data model. Screenshot below.

simrantuli_0-1603732736107.png

Basically, this is a survey data where Q1 & Q2 were two questions. People from various sites participated in this survey. Data of the 3 tables below:

Q1:

simrantuli_1-1603732876622.png

Q2:

simrantuli_2-1603732899458.png

Site_Summary:

simrantuli_3-1603732924918.png

Now, the requirement is to create a Line and Clustered column chart for each question with 'Global' represented by a Line and the rest of the sites represented by Bars. Measure being the sum of Response_Count. I was able to achieve it using the below DAX.

DAX for Line: CALCULATE(SUM(Q1[Response_Count]),Q1[Site]="Global")

DAX for Bars: CALCULATE(SUM(Q1[Response_Count]),Q1[Site]<>"Global")

My chart for Q1 looks like below with 'Site' from 'Site_Summary' table under Column Series and 'Response' from Q1 table as Shared axis. So far so good.

 

Capture.PNG

The problem comes when I select 'Global' from the slicer. My chart goes BLANK.

Capture1.PNG

However, it works fine when another site is selected along with 'Global'. Screenshot below.

Capture2.PNG

What could be the reason? How do I solve this?

I have also given the link below to download the PBIX file.

https://drive.google.com/file/d/1Qf9n6DP4fgJ9BDSNhu5sfdTxRiXWtX9N/view?usp=sharing 

You help would be greatly appreciated.

1 ACCEPTED SOLUTION
simrantuli
Responsive Resident
Responsive Resident

Thank you so much @camargos88  & @sfaizee for the answers.

 

I was able to fix this by checking 'Show items with no data' for 'Response' under Shared axis.

 
 
 

View solution in original post

8 REPLIES 8
simrantuli
Responsive Resident
Responsive Resident

Thank you so much @camargos88  & @sfaizee for the answers.

 

I was able to fix this by checking 'Show items with no data' for 'Response' under Shared axis.

 
 
 

View solution in original post

camargos88
Super User III
Super User III

@simrantuli ,

 

That's because you measure doesn't return anything for column values when you only select Global:

 

Q1_Response_Site = CALCULATE(SUM(Q1[Response_Count]),Q1[Site]<>"Global")

 

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Hi @camargos88,

 

Thanks for the answer.

Is there any way to make it work? I want to see the line if 'Global' is selected.

 

Thanks!

@simrantuli ,

Try this measure:

Q1_Response_Site = CALCULATE(SUM(Q1[Response_Count]),Q1[Site]<>"Global") + 0


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Hi @camargos88,

 

Thanks. It works.

However, I see 'Global' twice in the legend now. One for Bar, whose value is 0 now, and the other for Line.

simrantuli_0-1603736583628.png

Any way to get rid of the extra Legend value?

 

Thanks!

@simrantuli ,

 

Doesn't work for you if you just rename the line value like "Global - Line" ?



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



@camargos88 

It will create confusions.

The 2 globals are showing becuase there is a value in your table named global. 

try changing the graph type and it will be fixed. 

Or you can filter it out. 

 

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power BI User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

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