I have a dataset that looks like this
All of A1 - A15 have positive integer values
I want a graph with A1 - A15 on the x-axis and their values on the Y-axis with CN and RN as filters.
I am trying to create a bar chart. What should I be putting in Axis, Value, Tooltips, etc. This is my first time with anything like PowerBI.
If you start with table that looks like this:
You can select columns A1 through A3 and, in the query editor, use Transform > Unpivot Columns to get a table that looks like this:
Once you have it in that form, you can put the Attribute (column names) on the Axis and the Value column in the Value section.
Once you add the CN and RN slicers it should look like this:
Related
I have a DAX table "Sumtable" that calculates the the number of rows in "Maintable" for two cases: (1) all rows in Maintable and (2) the subset of rows where Cat = "A".
Sumtable = {
("Full set", COUNTROWS(Maintable)),
("Subset", COUNTROWS(FILTER(Maintable, Maintable[Cat] = "A")))
}
I want to viz Sumtable and make it respond to filter settings on Maintable. For example when I select Maintable[Sex] = "Male" the totals in Sumtable should reflect that. What is the right way to accomplish this?
For example when I select Maintable[Sex] = "Male" the totals in Sumtable should reflect that.
Just make this two measures instead of a calculated table.
If you want these measures to appear under Sometable, you can create a one-row, one-hidden-column table with two measures, instead of two calculated columns.
And when you hide all the non-measure columns on a table it becomes a "Measure Table" with a differentiated icon.
Solved it with this: analytics-tuts.com/bar-chart-using-measures-in-power-bi
I have a table of things, and multiple true/false columns of attributes for that thing.
I want to make a bar chart with one bar for each attribute, and the value being a count of Thing IDs where the attribute is TRUE:
I'm sure it's simple but I'm having trouble, and I'd appreciate any help.
In the Power Query editor, you can pivot the columns of the attributes.
Select the attribute columns and click on tab transform on Pivot column.
you will get:
ThingID | Attribute | Value
then you can add a conditional column to count the TRUE.
If value equals TRUE then 1 else 0
Then make a chart in PowerBI and your Axis is the Attribute column and the Values is your count column and your there.
I have 3 tables.
Table0 contains the column DateTime0
Table1 contains the columns DateTime1 and Price1.
Table2 contains the columns DateTime2, Price2, and Unit2.
I've linked DateTime0 with DateTime1, and DateTime0 with DateTime2.
I can put in a line plot of Price1 and Price2 as y-axis and DateTime0 as x-axis.
I can put in a slicer of DateTime0, and this then affects my line plot as expected.
I now want to put in a slicer of Unit2, such that Price2 displayed on my line plot would only come from those selected. But If I do this then my Price1 line dissapears, because it is also filtered.
How do I make it so that the slicer only affects the data coming from Table2?
I know I can do this with 2 seperate plots, but I want to be able to do it with one plot.
It looks like the cross filter direction of the relationship between DateTime0 and DateTime2 has the default value of Both, while what you want is to be Single. Double click the relation (it makes sense to change both relations) and change the value in Cross filter direction combo box to Single:
I am using a stacked bar chart for presenting the gender ratio in various region.
here the legend is gender and Axis is region and value is headcount.
when i want to sort the chart according to female gender value . the sorting is only done by the headcount value. how can i sort it for the percentage value. please help me.
EDIT: My first answer focused only on count, now I've taken into account that OP wants to sort by percentage female value
You can sort your data directly in your Stacked column chart visualization, after pivoting the data and adding a column showing the female percentage value using the Power Query Editor. If you insert the female ratio as a Tooltip, your chart can be sorted as that value even though it is not displayed in your chart.
Here are the details:
This data sample should fit your description:
Region,Gender,Count
USA,M,9000
USA,F,7000
EU,M,5000
EU,F,5000
UK,M,2000
UK,F,4000
CAN,M,100
CAN,F,900
If you enter that data using Edit Queries / the Power Query Editor, you can set it up like this:
Now highlight the Gender column, and select Transform > Pivot Column to get this:
Under Values Column, select Count and click OK to get this:
Now simpy add a custom column to calgulate the female ratio like so:
Now your table should look like this:
In the desktop, insert a stacked column chart and set it up like below. Notice that you'll need to insert F ratio under Tooltips:
Now you can sort your chart by Ascending or Descending F ratio
I have a Clustered column chart and for the Legend field and have to switch between 2 columns based on a slicer:
if no slicer is filtered then use column0 for Legend
if slicer is filtered then use column1 for Legend
I tried adding a calculated column like this
Column = IF(ISFILTERED(Table1[slicer]) = TRUE(), Table1[column1], Table1[column0])
And then use this column as Legend.
But this doesn't work!
Can you please advice me how to do it right?
You can't filter calculated columns by slicers.
Calculated columns are only calculated once - when you load/refresh your data model. After that, they contain fixed, static values that can not respond to slicers.
To achieve your goal, you will need to redesign your chart using measures, not calculated columns. Then your formula will look like this:
[Measure to Chart] = IF(ISFILTERED(Table1[slicer]), [Measure 1], [Measure 2])
If you want more help, I would recommend to post another question with more information about your data model and desired outcome.