Forum Discussion
Selected Filter Date / Column when appending data reports
- Anonymous3 years ago
Hi Anonymous ,
1. In Power BI, create a new table with the distinct dates from your data.Dates = DISTINCT('Table'[Date])Add a slicer to your report and use the new table as the source.
2. For the first question, create two measures to calculate the sum and average amount by contact as of the selected date:
SumAmountByContact = CALCULATE( SUM('Table'[Amount]), 'Table'[Date] <= SELECTEDVALUE('Dates'[Date]) )AvgAmountByContact = CALCULATE( AVERAGE('Table'[Amount]), 'Table'[Date] <= SELECTEDVALUE('Dates'[Date]) )
3. For the second question, create a measure to count the number of instances a contact had a win as of the selected date:CountWinsByContact = CALCULATE( DISTINCTCOUNT('YourTableName'[Contact ID]), 'YourTableName'[Stage (Bucketed)] = "Won", 'YourTableName'[Date] <= SELECTEDVALUE(Dates[Date]) )Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi Anonymous ,
1. In Power BI, create a new table with the distinct dates from your data.
Dates = DISTINCT('Table'[Date])
Add a slicer to your report and use the new table as the source.
2. For the first question, create two measures to calculate the sum and average amount by contact as of the selected date:
SumAmountByContact =
CALCULATE(
SUM('Table'[Amount]),
'Table'[Date] <= SELECTEDVALUE('Dates'[Date])
)AvgAmountByContact =
CALCULATE(
AVERAGE('Table'[Amount]),
'Table'[Date] <= SELECTEDVALUE('Dates'[Date])
)
3. For the second question, create a measure to count the number of instances a contact had a win as of the selected date:
CountWinsByContact =
CALCULATE(
DISTINCTCOUNT('YourTableName'[Contact ID]),
'YourTableName'[Stage (Bucketed)] = "Won",
'YourTableName'[Date] <= SELECTEDVALUE(Dates[Date])
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum