Power BI - Extract / Moving value to a separate column - powerbi

I have a column that includes 2 different values for more than 100k customers
The values are: "Consumer" , "SMB"
How can I move "SMB" values to a separate column ? I want each value to be shown in a different column so I can use KPI for each one of the values.
For ex: I want to create 2 different KPIs, one for SMB and 1 for Consumer, which show how money in total each segment has been charged.

When you load the data in the Power Query editor, use the command to split the column with the values. Use the comma as the delimiter.

Related

Binning in Power BI

I'm new in Dax in PowerBi and I wanna ask you if there is a way in which I can write a function where I can manually group the data in bins for example about 50mm, 25 mm, 10 mm, etc ?
The intention is to create a filter in which I write the number and then the data will be grouped based onn the values of the specified bins.
Your data doesn't match your bins but regardless, I would do this in Power Query. The absolute easiest way is highlight the column you're binning and then select add column - column from examples on the ribbon. Type in the first bin and Power Query will fill in the rest.
Adjust the bins if required and then click OK.
These are the steps which I follow
First
Second
Third
Forth

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.

Calculated column in Power BI that repeats different sums based on conditions in 2 other columns

I need a calculated column based on conditions in two columns (Business Unit Number in both tables and L1/Account Categories in 1st table and the second table) which sum and then repeat for several rows before the conditions change and a new sum is repeated for several rows and so on. The L1/Account Categories columns have different names because it's the raw data.
For example, any time ASSETS and 111 appear in the same row, I would want to use those as conditions and with the sum of all of the other matching rows in a new column and the sum would repeat each time both conditions appeared in the same row. Any time P/L and 111 appear in the same row, that would be a sum of all other P/L and 111 appearances in the dataset (about 1000 rows overall)... and so on.
I've tried formulas with DAX using FILTER, SUMX, nested IF statements and also tried the Power Query language among other attempts. Maybe I have to create one or more than one new table? If you need to take a look at a few of my attempts, just let me know.
The top image is how I imagine the output will look in the power query editor and the bottom image is a sample of the source data.
This last pic is from Tableau - I need to make a table in Power BI which essentially a duplicate of this image. The last 2 columns are pulling from different tables.
This should be very simple to achieve with relationships and measures - no need for calculated columns or power query merges. You need to build a relationship between these two tables. In fact, I would introduce a third table in your model for Business unit.
The limitation of Power BI model relationships is that they can only be based on a single column. So to build a relationship between these two tables you would have to add a calculated column in both of them that would contain both a BU and the financial statement line, for instance: JoinCol = CONCATENATE([Business_Unit_Number], [L1]). Then you could create a relationship and do what you want.
The better (one that I would recommend) approach would be to separate Business Unit into a separate table and have relationships built like this:
Then all you have to do in your visual is drag Business unit name from the BU table, L1 from the FS Lines table and a measure to sum the amounts Amount = SUM('Financial Data'[Rolled Up Detail]).
Here is a working sample: https://1drv.ms/u/s!AmqvMyRqhrBpgtUT5HKnZP1U3Gzc9w?e=en91dV

in Dax, how do I row match by some categorical column instead of getting a single value when using a numerical variable from another related table

How can I use the values of a variable from a table B in a related table A in a such a way that it can be matched to each row of table A correspondingly?
I need to calculate a ratio as this
sum(A[event_number])/sum(B[client_number]
The 2 variables are from different related table. The relation between the tables are one (A) to many (B).
When I put this ratio on a matrix constructed with variables and measures from table A where the rows are stores, the denominator should be the client number per store but I only get the sum of all clients instead.
For example if a store "ASD" has 5 events it should get divided by 20 which are the clients related to that store and not 500 which is the sum of all clients for all stores.
I have tried using related when calculating the ratio, and allexcept to create a column of number of clients in A but nothing has given the expected result. Please help.

How to perform comparison in Power BI?

I have two tables in Power BI - each has the exact same columns, however, one is from the past 7 days, and the other is from the 7 days before that. I simply want to be able to compare the data week-over-week, but am struggling to get it to work.
For example, a column used is "Source." It lists the source used for each row. I tried creating a clustered column chart and putting the "Count of Source" fields from each table in "Value" and then "Source" in "Axis." When I do this, it accurately displays the columns for one table, but the other tables' values are all messed up - it just shows the sum.
See image :