Forum Discussion
Martin1986
6 years agoFrequent Visitor
Working with multiple date columns
Hi, I have the following situation: 1 table named Forecast that has multiple date columns, simplified for this example 1. Start Date 2. Close date In addition, I created a Dates table wi...
amitchandak
6 years agoSuper User
Try this, you can create more than on relation in power BI. Few of them can be inactive. Means, join both dates with the same time dim and keep one active.
This sample formula to use one relation at a time
Sales 7 =
VAR Column1=
SELECTEDVALUE ( dim[DimColumn1])
VAR Column2 =
SELECTEDVALUE ( Sales[Second])
var Column3 =SUMMARIZE(Sales,Sales[Column1])
var Column4 =SUMMARIZE(Sales,Sales[Column2])
RETURN
CALCULATE( SUM (Sales[Sales]),
dim[DimColumn1] in Column3 ,USERELATIONSHIP(dim[DimColumn1],Sales[First])
)+CALCULATE( SUM (Sales[Sales]),
dim[DimColumn1] in Column4 ,USERELATIONSHIP(dim[DimColumn1],Sales[Second])
)
Martin1986
6 years agoFrequent Visitor
Sorry, but could you show example data with it? I'm a bit confused what column1, column2 etc are meant to be.