Forum Discussion
Measure to Sum Value based on Date Ranges in One Table Given Date From Another
- 6 years ago
Anonymous ,
It works as a measure. Expected from you.
From your pbix file.
and without Seller ID.
Just do not summarize SalesAmount.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
If possible please share a sample pbix file after removing sensitive information.
Thanks
- amitchandak6 years agoSuper User
Can you create a new column (not measure) like this
Cost Column = sumx( filter(Table2,Table2[CustomerEndDate]>=Table1[SaleDate] && Table1[SaleDate]>=Table2[CustomerStartDate] && Table1[CustomerID]=Table2[CustomerID]),Table2[CustomerCost])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601- Anonymous6 years agoNot applicable
amitchandak wrote:Can you create a new column (not measure) like this
Cost Column = sumx( filter(Table2,Table2[CustomerEndDate]>=Table1[SaleDate] && Table1[SaleDate]>=Table2[CustomerStartDate] && Table1[CustomerID]=Table2[CustomerID]),Table2[CustomerCost])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601So, this technically works but still isn't a measure. Does DAX not allow this type of formulation as a measure..? The reason I ask is because this will make me have to put in a request to the IT group to add a column to their model instead of being able to incorporate this as a measure myself through Power BI.
- amitchandak6 years agoSuper User
Please check -https://www.dropbox.com/s/z5934qq5ntjw7pi/CustomerSample.pbix?dl=0
You should able to create a new column from the visualization layer. Unless that is not as per policy.