Forum Discussion
Trying to plot data using a filter from a custom column
Hi all,
I am relatively new to PowerBI and am tryig to plot data using a filter based on a custom column created with 2 basic conditions at the same time. The dropbox file link is in the end, let me know if you have issues accessing it. What I am trying to get is to plot a count of indicator 1 for all indicator 3 values. I need to plot only the count of indicator 1 for which the conditions of the custom column are met (indicator5 = 3 and indicator 3 (year) = 2022). I created the custom column usingthe formula =if ([Indicator5] = 3 and [Indicator3] = 2022) then "Yes" else "No". The formula works as I get only 4 Indicator1 which meet the criteria. But when I try to plot it for all years (indicator3) and it plots only indicator 3 = 2022 as per file. I am trying to get counts based on conditions for all years (indicator3) values. Any idea how to set this up so I can either create a plot or have a table with counts. This is a sample file created to demonstrate the problem, the actual file has more that 4 milion rows.
Hope the description is clear.
Your help is appreciated.
Link to PBIX file: https://www.dropbox.com/s/g9k4wx0o3my7ggz/Sample%20File.pbix?dl=0
Hi, I am trying to plot Indicator1 (y-axis) as a function of indicator of indicator3 (x-axis) with the conditions specified using indicator5 as a legend so I can see how indicator5 changed. For the given indicator1 that meet the conditions I need to plot them for all indicator3 or years and not just 2022.
I solved the problem by saving indicator1 numbers that meet the 2 conditions (using custom column as a slicer) as a separate table with the same column name (indicator1). Then create a relationship between the two columns (indicator1)of the 2 tables. After that create a new column to use as a slicer and I get the below screenshot which is what I was looking for. I do not know if there is an easier way to do this but this method works.
3 Replies
- bmind1979New Member
Perhaps this can be done in another way that it is easier instead of a custom column? Extract indicator 1 data and save as separate table, link tables together with indicator 1 being one to one and then plot old table using the new table as a slicer? I do not know if this is possible...or how to do it if it is possible.
Perhaps there is an easier fix?
- AnonymousNot applicable
Hi bmind1979 ,
If my understanding is correct, you would like to get the count of indicator1 when it fulfill the conditions(indicator5 = 3 and indicator 3 (year) = 2022). If yes, you can create two slicers using the field [indicator 3] and [indicator 5] separately just as below screenshot to get it:
If the above one is not your expected result, please provide some specific example to explain your requirement. Thank you.
Best Regards
- bmind1979New Member
Hi, I am trying to plot Indicator1 (y-axis) as a function of indicator of indicator3 (x-axis) with the conditions specified using indicator5 as a legend so I can see how indicator5 changed. For the given indicator1 that meet the conditions I need to plot them for all indicator3 or years and not just 2022.
I solved the problem by saving indicator1 numbers that meet the 2 conditions (using custom column as a slicer) as a separate table with the same column name (indicator1). Then create a relationship between the two columns (indicator1)of the 2 tables. After that create a new column to use as a slicer and I get the below screenshot which is what I was looking for. I do not know if there is an easier way to do this but this method works.