I have created a calculated table (Table A) which contains opening and closing values for certain assets on specific dates.
I want to append a virtual table (Table B) to add rows containing opening and closing values of all assets as of the date selected by the user in a slicer.
This should allow me to calculate time weighted returns (TWR) of assets between specific periods of time where TWR = Product(Return in each period) and Return in each period = Closing Value / Opening Value as of each date in the combined table.
My question is whether the Combined Table created using the Union function in DAX would inherit the relationships that Table A has with other dimension tables such as Date Table and Asset Table? If not, what is the best way to go about doing this so that the relationships are maintained?
Thanks.
Related
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).
I have two tables one contains User data and other is my dates table.
Is it possible to copy each row from users table for each date from dates table like below?
It is possible using transformations:
Add custom column(column formula is second table name):
Expand column:
I am trying to create a separate table that will have dates between Start_Date and End_date. These dates are measures. Below is the detail of my requirement..
I have a Dropdown in report which lists distinct dates of fact.sales table and is a single select. I am saving this selected date in a Measure --> End_Date = selectedvalue(sale[Delivery Date Key]).
Now I am showing a report using what-if parameter. The slider slides from values 1 to 24.
Now I am creating another Measure..
Start_Date = date(year('Date'[End Date]),MONTH('Date'[End Date])-Cust_Key[Cust_Key Value],1)`
The Problem - When I try to use calendar function to create table using below DAX function, I get an error - "The start date or end date in Calendar function can not be Blank value."
calendar = calendar('Date'[Start Date],'Date'[End Date])
Can measures not be used inside the Calendar/GenerateSeries function.. Thanks in advance..
The SELECTEDVALUE function will return a blank if you haven't selected a single value. Note that calculated tables cannot read slicer values since they are only computed when the data is loaded, not whenever you interact with a slicer. Therefore, your End_Date measure returns a blank since it isn't filtered by the slicer.
You can use measures within any calculated tables but they won't interact with any dynamic slicers or filters. Calculated tables in your data model are static once the model is loaded. You can, however, use temporary/dynamic calculated tables within a measure so long as the measure still returns a single value at the end.
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
i have a table like:
item startdate enddate.
I want to create a single visual in Power BI with how many item start each quarter and how many item end each quarter.
This is just one of the ways to do it.
Let's say your table is called items1
create a copy of items1 - items2
at this point you can remove columns items1[enddate] and items2[startdate]
if your dates include time part, remove it
create a date table, dates, make sure it's populated.
create relationships between dates and items1[startdate], dates and items2[enddate]
plot countrows(items1) and countrows(items2) against dates