Line chart with separate lines for different groupings in Power BI - powerbi

I have data in the following format:
I want to produce a line chart with three lines for each value in Field1 (I.e. a line for A, B and C)
How is this achieved? Do I need to split my data into three separate tables?
Thanks

You don't need to split your data into 3 tables which is not needed.
Please check the Power BI screenshots to achieve it simply.

Related

Line chart with two value variables showing one as total sum and the other as actual values

I am attempting to create a line chart with two separate lines, by applying separate filters. To do so I have used slicers to create two tables CF1 and CF2 which is the original data filtered for the respective filters on the LHS and RHS of the data below (using relationships).
However, when displaying the information on a chart the second set of data is showing as the sum of the values instead of values as CF1 is.
I have tried creating a line chart with only CF1 or CF2 as the values and that works without issue.
To make this happen you need a common X-axis column to establish the evaluation context.
Now you are using the date column from one of the tables, say Table 1 which causes the measure that scans your Table 2 to just sum all entries, since the evaluation context does not filter Table 2 at all.
Read up on calendar tables and implement that. There are plenty of resources on this on the Web. See this example from Radacad, for instance.

Filter only one value/line on line chart in Power BI

I have a line chart with two lines that show attendance scores for each gender (male and female). I would like to only apply/filter one of the lines while the other is disabled from filtering.
This will allow viewers to compare the overall numbers (both genders) with the filtered numbers (each seperate gender). Is there a way to do this?
You can do this by creating a slicer to select between different measures.
You would have to create two new measures (One filtered for male data and other filtered for female data). Using the slicer you can switch between the two measures and achieve what you are looking for.
The following link details the steps:
https://www.burningsuit.co.uk/blog/2018/03/dax-how-to-use-a-slicer-to-select-different-measures/
Sorry if i am wrong but why are you not summing the both attendance in other column and then use it as you want (else might be i dint got your question correctly)

Bar Chart Summarizing a Concatenated Column (or Multiple Columns) in Power BI

I currently have a column that lists a series of codes for the different business units we have, however, each entity can have more than one business unit affiliated with it (between 1 and 15 affiliations)
I then have a separate list of all the affiliation codes so I can make a simple bar chart showing metrics broken down by affiliation code, but I'm not sure how to make the relationship between the stand-alone list of codes and the entity data.
Any help would be appreciated - thanks
You need to normalise the table with the three columns. This can be done with Power Query.
Split the Affiliations into separate columns, then Unpivot all but the Entities column. After that, build your result from this new table.

Grouping by multiple columns and aggregating all values

I am rather new to Power Bi and I have a question i can't find the answer to.
I want to import a table that have some label columns, with repeated items, and more than 15 data columns.
My desire result would be to group the label columns, so no repeated items, and aggregate the values of the remaining columns.
Is there a way to do that in PQ editor or DAX ?
I appreciate any help or direction you can give me!
A sample of the table (it's much bigger, with multiple values in the first three columns)
Table Sample
Thanks a lot
Edit: From that sample, the output y I want is the following
Output Sample
The thing is, there are many different values in the first columns, and i need to agreggate all the other values, keeping they column name (cause this info is already linked to other files).
Maybe the only way is to group by and add the columns, renaming them one by one?
I want to do this in a couple of files, so if you know of another way please let me know!
In your query designer import your table. Then go to Home > Group By and group like you want it, the same goes for the aggregations and thats it.
If you just want to remove row duplicates, just group all columns which you dont want to aggregate and the rest can be aggregated like you want it.

Merge or combine two columns in power bi

I am not sure if my title is correct one, but here is the deal:
I want to make a matrix visualization in Power Bi Desktop. I have fields: ARTICLE_ID and ARTICLE_NAME.
I would like to have both those fields in COLUMNS position in matrix data view. And I need them to be in one row, no need to drill down... because it is one and the same thing...
I need to have ARTICLE_ID and ARTICLE_NAME as two separate columns on the same level. without drilling. And also, I dont want to use concatenation or merging into some third column. is that possible? thanks
1) I started with this sample data.
2) I created a matrix and configured it as shown in the image below.
3) I clicked the forked arrows to show all levels.
4) In the Rows section of the formatting pane, I turned off "Stepped layout".
5) In the Subtotals section, I turned off "Row subtotals".
I don't know if this is exactly what you are looking for, but I think it is the closest I can come up with since you don't want to concatenate the columns together.
If they are from the same table then just drag and drop them into the columns.
The way a matrix works from my understanding in PowerBI is;
Rows are just the headings/categories of the values.
You might need to also go into the format tab, values, and make sure show on rows is on.
For example, let's say our value headings are rainy days and sunny days.
Your columns are months.
The rows will be the 2 categories.
The values will be the values.
As concatenation and "&" does not work in Power BI directquery you can use the below one:
[New_column_name] = if((table_name[column_name]="A" && table_name[column_name]="B"),"AB","NA")
Thanks,
Sachin Kashyap