Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I want to see the Price and Reviews of items based on the selected date.
When I'm using only one data slicer the values are present, however, when I'm selecting two different dates on two slicers the values are not showing correctly.
I've created those measurements:
D-Price (EndDate) = CALCULATE(AVERAGE(MergedTables[Price]),FILTER('Sorted Dates', SELECTEDVALUE('Sorted Dates'[EndDate])))
D-Price (StartDate) = CALCULATE(AVERAGE(MergedTables[Price]),FILTER('Sorted Dates', SELECTEDVALUE('Sorted Dates'[StartDate])))
D-Reviews (EndDate) = IF(ISBLANK(CALCULATE(MAX(MergedTables[AmountReviews]),FILTER('EndDates', SELECTEDVALUE('Sorted Dates'[EndDate])))), 0, CALCULATE(MAX(MergedTables[AmountReviews]),FILTER('Sorted Dates', SELECTEDVALUE('EndDates'[EndDate]))))
D-Reviews (StartDate) = IF(ISBLANK(CALCULATE(MAX(MergedTables[AmountReviews]),FILTER('StartDates', SELECTEDVALUE('Sorted Dates'[StartDate])))), 0, CALCULATE(MAX(MergedTables[AmountReviews]),FILTER('Sorted Dates', SELECTEDVALUE('StartDates'[StartDate]))))
Where the table SortedDates is:
Sorted Dates =
ADDCOLUMNS(
DISTINCT(
MergedTables[Date]),
"DateSort", - DATEDIFF ( TODAY (), MergedTables[Date] , DAY ), "StartDate", MergedTables[Date], "EndDate", MergedTables[Date]
)
And the Merged Tables look similar to:
Activity | Price | Reviews | Date |
ABC | 10 | 10 | 14/08/2022 |
ABC | 11 | 10 | 15/08/2022 |
ABC | 10 | 11 | 16/08/2022 |
ABC | 15 | 12 | 17/08/2022 |
DEF | 24 | 150 | 14/08/2022 |
DEF | 23 | 150 | 15/08/2022 |
DEF | 20 | 150 | 16/08/2022 |
DEF | 12 | 151 | 17/08/2022 |
AAA | 90 | 200 | 14/08/2022 |
AAA | 345 | 250 | 15/08/2022 |
AAA | 90 | 300 | 16/08/2022 |
AAA | 90 | 350 | 17/08/2022 |
The idea is to show values based on selected Start and End dates. Since sometimes I would like to compare today to yesterday and to last month/year value etc.
Solved! Go to Solution.
I probably found the solution for my own issue. So I've changed the measure to the below one. Also very important to delete the connection between Merged Tables and tables which are in the Slicers.
D-Price (EndDate) = CALCULATE(AVERAGE(MergedTables[Price]), FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(EndDates[Date])))
D-Price (StartDate) = CALCULATE(AVERAGE(MergedTables[Price]), FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(StartDates[Date])))
D-Reviews (EndDate) = IF(ISBLANK(CALCULATE(MAX(MergedTables[AmountReviews]),FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(EndDates[Date])))),
0,
CALCULATE(MAX(MergedTables[AmountReviews]),FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(EndDates[Date]))))
D-Reviews (StartDate) = IF(ISBLANK(CALCULATE(MAX(MergedTables[AmountReviews]),FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(StartDates[Date])))),
0,
CALCULATE(MAX(MergedTables[AmountReviews]),FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(StartDates[Date]))))
I probably found the solution for my own issue. So I've changed the measure to the below one. Also very important to delete the connection between Merged Tables and tables which are in the Slicers.
D-Price (EndDate) = CALCULATE(AVERAGE(MergedTables[Price]), FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(EndDates[Date])))
D-Price (StartDate) = CALCULATE(AVERAGE(MergedTables[Price]), FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(StartDates[Date])))
D-Reviews (EndDate) = IF(ISBLANK(CALCULATE(MAX(MergedTables[AmountReviews]),FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(EndDates[Date])))),
0,
CALCULATE(MAX(MergedTables[AmountReviews]),FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(EndDates[Date]))))
D-Reviews (StartDate) = IF(ISBLANK(CALCULATE(MAX(MergedTables[AmountReviews]),FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(StartDates[Date])))),
0,
CALCULATE(MAX(MergedTables[AmountReviews]),FILTER(MergedTables, MergedTables[Date] = SELECTEDVALUE(StartDates[Date]))))
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
62 | |
62 | |
52 | |
39 | |
24 |
User | Count |
---|---|
85 | |
57 | |
45 | |
43 | |
38 |