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.
Hi I have writen direct query which is giving result like this
snapshot_datetime | SYMBOL | CurrentPrice | Starting Price | Diff from start |
1 Jan | EAFE | 88 | 88 | 0 |
2 Jan | EAFE | 23 | 88 | 65 |
3 Jan | EAFE | 34 | 88 | 54 |
4 Jan | EAFE | 45 | 88 | 43 |
5 Jan | EAFE | 12 | 88 | 76 |
1 Jan | US30 | 55 | 55 | 0 |
2 Jan | US30 | 76 | 55 | -21 |
3 Jan | US30 | 23 | 55 | 32 |
4 Jan | US30 | 34 | 55 | 21 |
5 Jan | US30 | 67 | 55 | -12 |
...
Now user can select any date in slider. But when he select dates in Slider, starting point would be first value of selected subset data.
for ex: here user selected 2 Jan. so the out put should be (my expected result)-
snapshot_datetime | SYMBOL | CurrentPrice | Starting Price | Diff from start |
2 Jan | EAFE | 23 | 23 | 0 |
3 Jan | EAFE | 34 | 23 | -11 |
4 Jan | EAFE | 45 | 23 | -22 |
5 Jan | EAFE | 12 | 23 | 11 |
2 Jan | US30 | 76 | 76 | 0 |
3 Jan | US30 | 23 | 76 | 53 |
4 Jan | US30 | 34 | 76 | 42 |
5 Jan | US30 | 67 | 76 | 9 |
Problem - I tried to create a measure via function but it is picking 'Start Price' from the original table and giving me this result which I am not expecting
instead output i am getting -
snapshot_datetime | SYMBOL | CurrentPrice | Starting Price | Diff from start |
|
2 Jan | EAFE | 23 | 88 | 65 | Incorrect Starting Price |
3 Jan | EAFE | 34 | 88 | 54 |
|
4 Jan | EAFE | 45 | 88 | 43 |
|
5 Jan | EAFE | 12 | 88 | 76 |
|
2 Jan | US30 | 76 | 55 | -21 |
|
3 Jan | US30 | 23 | 55 | 32 |
|
4 Jan | US30 | 34 | 55 | 21 |
|
5 Jan | US30 | 67 | 55 | -12 |
|
DAX i am using to get Starting Price is
Measure:Starting Price = var _symbol = SELECTEDVALUE('MarketData'[symbol]) return CALCULATE( MAX('MarketData'[CurrentPrice]), FILTER( ALL('MarketData'), 'MarketData'[symbol] = _symbol&& 'MarketData'[snapshot_datetime] = CALCULATE( MIN('MarketData'[snapshot_datetime]), FILTER( ALL('MarketData'), 'MarketData'[symbol] = _symbol && 'MarketData'[snapshot_datetime] >= [minselectedDate] ) ) )) |
|
minselectedDate = CALCULATE( MIN( MarketData[snapshot_datetime] ), ALLSELECTED( MarketData[snapshot_datetime] ) )
|
Could anyone help me to overcome this problem.?
Thanks
Manish
Solved! Go to Solution.
Start Price=calculate(firstnonblankvalue('MarketData'[snapshot_datetime],MAX('MarketData'[CurrentPrice])),ALLSELECTED( MarketData[snapshot_datetime] ))
Start Price=calculate(firstnonblankvalue('MarketData'[snapshot_datetime],MAX('MarketData'[CurrentPrice])),ALLSELECTED( MarketData[snapshot_datetime] ))
Thanks Daniel, its worked like a charm
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 |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |