Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I want to show live Oil price.
I have Oil price, daily date and material name fields. Using these fields I want to show live price.
if there is any price today then we have to show today Live price. Else previous price value.
can you please help me how to do this
This is very urgent requirement
Thanks in advance.
Hi @BhavyaM ,
I have created a sample table:
Create a measure like this:
Live price =
IF (
SELECTEDVALUE ( 'Table'[Material name] ) = "A"
&& SELECTEDVALUE ( 'Table'[Daily date] ) = TODAY (),
"Live price of A is today: "
& CALCULATE (
SUM ( 'Table'[Oil price] ),
'Table'[Material name] = "A",
'Table'[Daily date] = TODAY ()
),
IF (
SELECTEDVALUE ( 'Table'[Material name] ) = "A"
&& SELECTEDVALUE ( 'Table'[Daily date] ) <> TODAY (),
"Live price of A is previous: "
& CALCULATE (
SUM ( 'Table'[Oil price] ),
FILTER (
'Table',
'Table'[Material name] = "A"
&& 'Table'[Daily date]
= CALCULATE (
MAX ( 'Table'[Daily date] ),
FILTER (
'Table',
'Table'[Material name] = "A"
&& 'Table'[Daily date] < TODAY ()
)
)
)
),
IF (
SELECTEDVALUE ( 'Table'[Material name] ) = "B"
&& SELECTEDVALUE ( 'Table'[Daily date] ) = TODAY (),
"Live price of B is today: "
& CALCULATE (
SUM ( 'Table'[Oil price] ),
'Table'[Material name] = "B",
'Table'[Daily date] = TODAY ()
),
IF (
SELECTEDVALUE ( 'Table'[Material name] ) = "B"
&& SELECTEDVALUE ( 'Table'[Daily date] ) <> TODAY (),
"Live price of B is previous: "
& CALCULATE (
SUM ( 'Table'[Oil price] ),
FILTER (
'Table',
'Table'[Material name] = "B"
&& 'Table'[Daily date]
= CALCULATE (
MAX ( 'Table'[Daily date] ),
FILTER (
'Table',
'Table'[Material name] = "B"
&& 'Table'[Daily date] < TODAY ()
)
)
)
),
IF (
SELECTEDVALUE ( 'Table'[Material name] ) = "C"
&& SELECTEDVALUE ( 'Table'[Daily date] ) = TODAY (),
"Live price of C is today: "
& CALCULATE (
SUM ( 'Table'[Oil price] ),
'Table'[Material name] = "C",
'Table'[Daily date] = TODAY ()
),
IF (
SELECTEDVALUE ( 'Table'[Material name] ) = "C"
&& SELECTEDVALUE ( 'Table'[Daily date] ) <> TODAY (),
"Live price of C is previous: "
& CALCULATE (
SUM ( 'Table'[Oil price] ),
FILTER (
'Table',
'Table'[Material name] = "C"
&& 'Table'[Daily date]
= CALCULATE (
MAX ( 'Table'[Daily date] ),
FILTER (
'Table',
'Table'[Material name] = "C"
&& 'Table'[Daily date] < TODAY ()
)
)
)
),
BLANK ()
)
)
)
)
)
)
Use two slicers and a card visual to show the result:
Attached my sample file that you can refer: Live price.pbix
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
@BhavyaM , Not very clear. If you have some API, you can get the data and show it.
Currently I am using share pint excel to delvelop reports so there will be BRM integration. So is it possible to develop current live price and difference of current and previous price and its percentage.
Can you please help how to work with API
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
84 | |
66 |