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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PBI_Rookie
Helper I
Helper I

Control Charting-ALLSELECTED

Hello All,

 

I've previosuly created control charts using a dataset with only the data needed. I am now trying to use the same measures to create the control charts where the data needed is only a subset. 

 

I am using 4 measures, the two below and one to make the upper and lower limits. 

 

ControlChart Average = CALCULATE(AVERAGEX(TABLE, COLUMN with data needed),ALLSELECTED(Identifier I want to sort by]))
 
ControlChart STDDev = CALCULATE(STDEVX.P(Table],column with data needed),ALLSELECTED(identifier i want to sort by)
 
My issue is that while I'm getting the correct values, my chart is including identifiers that aren't tied to the data. My x-axis is the sample field used in the ALLSELECTED. 
 
If I use ALLSELECTED I get x-axis labels that aren't relevant. If I don't use ALLSELECTED I get the values calculated for each datapoint and not the whole range. 
 
Without ALLSECLTED
PBI_Rookie_0-1630260010552.png

 With ALLSELECTED

PBI_Rookie_1-1630260118112.png

 

 Any suggestions?
 
Thanks
1 ACCEPTED SOLUTION

I was finally able to get this to work. 

 

I used AllSELECTED as I described initially. What I had to do to make it work however was to duplicate my source table and filter it to be only the needed information. In this case the sample IDs. 

View solution in original post

8 REPLIES 8
v-xiaoyan-msft
Community Support
Community Support

Hi @PBI_Rookie ,

 

Has your problem been solved? If it has been solved, please accept the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!

 

 

 

 

 

Community Support Team _ Caitlyn Yan


If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

littlemojopuppy
Community Champion
Community Champion

Hi!  Try changing ALLSELECTED() to KEEPFILTERS(Identifier I want to sort by]).

Hi, 

 

Ok I tried replacing the ALLSLECTED in both measures with KEEPFILTERS. I get an error that "Cannot convert value (identifier) of type TEXT to type True/False"

 

 

😮  Well that is certainly an unusual error message...

 

Can you provide some sample data to play with?

Playing with KeepFilters a bit I can see why it is giving me that error. If I alter it a bit i.e. KeepFilters(Column="") i will not get the error. Unfortunately it also does not solve the initial issue. 

I think I was a little off...try KEEPFILTERS() with whatever is on the X axis

I was finally able to get this to work. 

 

I used AllSELECTED as I described initially. What I had to do to make it work however was to duplicate my source table and filter it to be only the needed information. In this case the sample IDs. 

Could you please describe more of your solution.

Is dublicate source related to original table?

Do you use new table's ID on x-axle?

How do you filter new ID-table? Can you still use slicers?

 

I have similar case with control charts.

 

In my case there is quality data from different machines in the same table. On control chart I want to show only selected machine on selected timerange. I use slicer for that as I don't want to create 20 dublicate tables for each machine.

Evertyhing works fine until I add a measure that includes ALLSELECTED. See below.

SamiS_0-1638273838838.png

 

Next I want to add AVG line, but this happens:

SamiS_1-1638273971566.png

AVG-line is calculated correctly (includes only rows I have selected) but x-axle is still showing all the rows that should be filtered off.

DAX for AVG-line is: CALCULATE[AVG_RH%], ALLSELECTED(Inspections[Id]))

 

Visual is filtered by using slicer, that actually filters 'machines' table. 'Machines' table is related to 'Inspections' table. Slicer filters linevalues on visual but x-axle values stay.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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