Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Measure is not using Subset Table to calculate value instead using Original Table! how to solve?

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

 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

Start Price=calculate(firstnonblankvalue('MarketData'[snapshot_datetime],MAX('MarketData'[CurrentPrice])),ALLSELECTED( MarketData[snapshot_datetime] ))

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

Start Price=calculate(firstnonblankvalue('MarketData'[snapshot_datetime],MAX('MarketData'[CurrentPrice])),ALLSELECTED( MarketData[snapshot_datetime] ))

Anonymous
Not applicable

Thanks Daniel, its worked like a charm

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.