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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
M-M-P
Helper III
Helper III

Value multiplied based on which year is shown in a graph

Hi
I am trying to get a value multiplied based on which year is shown in a graph.

Somewhat simplified. I have 3 tables, Data, calenderdateTime and LookUp.

lookup.pngCalenderdatatime.pngData.png

Data and CalenderDateTime are connected via timestamps, but LookUp is independent.

It is the value "Add value" in the LookUp table that must change based on the year and then multiplied by the Value from the Data table.

I can't figure it out. Hope someone can help.

 

Thanks in advance

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @M-M-P 

You can refer to the following example:

1.you can creata a new measure:

Output = var _look=MAXX(FILTER(Lookup,[Year]=YEAR(MAX('Calenderdate Time'[Tamestamp]))),[Add value])
return MAX(Data[Value])*_look

vxinruzhumsft_0-1673838412191.png

 

2.You can create a calculated column

vaule*lookup = var _lookaddcalue=LOOKUPVALUE(Lookup[Add value],[Year],YEAR([Tamestamp]))
return [Value]*_lookaddcalue

vxinruzhumsft_1-1673838502615.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @M-M-P 

You can refer to the following example:

1.you can creata a new measure:

Output = var _look=MAXX(FILTER(Lookup,[Year]=YEAR(MAX('Calenderdate Time'[Tamestamp]))),[Add value])
return MAX(Data[Value])*_look

vxinruzhumsft_0-1673838412191.png

 

2.You can create a calculated column

vaule*lookup = var _lookaddcalue=LOOKUPVALUE(Lookup[Add value],[Year],YEAR([Tamestamp]))
return [Value]*_lookaddcalue

vxinruzhumsft_1-1673838502615.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@M-M-P , You can create a  new column in data table

 

maxx(filter(lookup, lookup[Year] = year(Data[timestamp]) ), lookup[Add Value])

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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