Power BI creating table/report from multiple tables - powerbi

I am new to power bi and trying to create table/report that pulls data from three different tables.
I have one table "Conversion": with columns like: conversion_id, date_converted,channel, revenue and other columns and measures
Second table "Qualification": Qualification_id, date_qualified, channel, revenue and other columns and measures
Third table "Spend" : Date, channel, Spend and other columns and measures
Qualification_id is same as conversion_id but it could have different dates (dates for id that got converted and qualified many times differ) and not every id that converts qualifies.
I want to display sum(spend) , count of qualifications , count of conversion and qualification rate (qualification/conversion) grouped by date and channel in one report
There were no relationships detected in amongst these three tables. Please note that the date values are not unique. I am looking into creating star schema and calculated table but since I am super new to this I am struggling to create this view. Any help would be appreciated!

If I have understood correctly ,conversion_id & date_converted will match Qualification_id & Qualification_date ,if the Conversion_ID qualifies.
If this is the case maybe you can create a new Column in both the tables which will be a concatenation as below and join those two columns like
Qualification_Key = Qualification_id & "-" & Qualification_date
Conversion_Key = Conversion_ID & "-" & date_converted

Related

Create Rows to the table where the data is missing for specific dates in power BI

I have a table with below columns in my dataset. We have monthly revenue for each resellers in this table.
For few resellers, there will be no data for some particular months, as they didn’t generate revenue on those months. I want to create rows for those resellers with the missing date and the revenue for those missing dates to be updated as blank.
Please advise how we can achieve this.
Current data:
Expected result:
For the missing dates you need to create a date table using the CALENDAR function like this:
Date table = CALENDAR(MIN(Date), MAX(Date))
This will create a table with a single colmn containing all the dates in your table with filled gaps (even if you don't have certain dates in your table). Then you need to create a relationship between your table and the date table.
When you use the date and the revenue in a visual lets say table or matrix all dates will be visible but the revenues will be blank (except for those that actually had a value in revenue).

Power BI: Count the number of times a value appears in another table

I have 2 tables, one of which includes a column of id numbers. The other table has a column with multiple occurrences of each id-number. I would like to add a column to the first table telling me how many times each id appears in the second table.
Power Bi is new to me so I have gotten nowhere so far.
If you have relationship between these two table on this ID then you can use simple measure:
CountOF = CALCULATE(countrows(detail))

Trying to create a line chart with two lines for similar data from same data table

I'm trying to create a line chart in Power BI with two lines representing counts by date. The data is pulled from a single data table. I am trying to show two lines, one representing an incoming count and one representing an outgoing count. Each record has a unique identifier (IN). So, the chart would have months on the x-axis pulled from a date table I created. One line would show the count of incoming IN for each month, and the other line would show the count of outgoing IN for each month. When I try to do this, both lines show the same count. I've tried a number of different measures, but nothing seems to work. These are the latest that I'm trying.
Intake by Date = CALCULATE(DISTINCTCOUNT('sysadm kennel (2)'[impound_no]),'sysadm kennel (2)'[intake_date])
Outcome by Date = CALCULATE(DISTINCTCOUNT('sysadm kennel (2)'[impound_no]),'sysadm kennel (2)'[outcome_date])
I'm pretty new to Power BI, so I don't have a full grasp of how to create measures. The Intake By Date seems to be the correct one, but the Outcome by Date is showing the same number. Any help would be appreciated.
Check your model. Create an active relationship between Calendar and DataTable to your Intake; Add an inactive relationship between Calendar and DataTable to your Outcome; In measure for [Outcome by Date] use USERELATIONSHIP('Calendar'[Date],DataTable[OutcomeDate])
https://dax.guide/userelationship/

How to add multiple column to slicer in Power BI

How can we show multiple columns into one slicer? Let's say I have three columns - product category, product and type. I want display three columns into one slicer.
How can I do this in Power BI Desktop?
You will need to go to your data model and add a new calculated column to the relevant table that concatenates the three columns. Use this new column as the field in your slicer.
SlicerData = [column1] & ", " & [column2] & ", " & [column3]
However, in most cases you get a lot more flexibility by having three different slicers, one for each column. Not to mention three slicers with 10 items each is much more convenient than one slicer with 1000 items.

Create table comparing Two Queries with identical fields/field names

I would like to create a table to compare Month To Date (MTD) Vs YTD Sales data metrics
I am using two queries:
1st query = YTD Sales data (Two fields: Sales and Quotes)
2nd query = MTD Sales Data (Two Fields: Sales and Quotes).
Each query has the same field names, just different data
I would like to output a table like the following
How to I create the above table? At the moment I can only create a table like the following:
The latter 1x4 table only works if I appropriately name the fields. But definitely isn’t what I want, because with enough fields, the table could go on forever.
Any help would be appreciated
In the query editor, create a label column for each table that labels what they are and then append the two tables together so you get something like this:
Then you can create a matrix visual with the Label column in the Columns field and the Sales and Quantity columns in the Values area.
Make sure you've switched "Show on Rows" to "On" under the Format > Values section of the Visualizations pane.