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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Paulo123
Frequent Visitor

Dynamic Measure for Identifying the Latest Value by Date and Table Source

Boa tarde.

Pretendo criar uma medida com base nos dados em anexo. A medida deverá considerar o filtro de data atualmente ativo e, com base nesse filtro, identificar o último valor disponível na coluna 'Montante 2' correspondente à data em questão. Importa referir que os dados estão distribuídos por várias tabelas com estrutura idêntica, pelo que a medida deverá também considerar qual a tabela relevante para a pesquisa do valor.

 

I intend to create a measure based on the attached data. The measure should take into account the currently active date filter and, based on that filter, identify the latest available value in the 'Montante 2' column corresponding to the given date. It is important to note that the data is distributed across several tables with identical structures, so the measure must also consider which table is relevant for retrieving the value.

 

obrigado

 

anexo

relação

Captura de ecrã 2025-10-28 130834.png

 

tabela 2

NomeDataMês Ano  montante montante 2%
XPT01/01/2025janeiro  2.025    74.818,00    33.855,00  2,0000%
XPT02/01/2025janeiro  2.025    23.229,00    13.610,00  2,00%
XPT03/01/2025janeiro  2.025    77.146,00      2.829,00  2,00%
XPT04/01/2025janeiro  2.025    66.510,00      3.429,00  2,00%
XPT05/01/2025janeiro  2.025    63.691,00      9.317,00  2,00%
XPT06/01/2025janeiro  2.025    51.566,00    50.442,00  2,00%
XPT07/01/2025janeiro  2.025    11.099,00    71.748,00  2,00%
XPT08/01/2025janeiro  2.025    33.103,00    16.988,00  1,00%
XPT09/01/2025janeiro  2.025    34.406,00    70.820,00  2,00%
XPT10/01/2025janeiro  2.025    43.854,00    42.044,00  3,00%
XPT11/01/2025janeiro  2.025    18.502,00    30.935,00  7,00%
XPT12/01/2025janeiro  2.025    51.686,00    25.897,00  8,00%
XPT13/01/2025janeiro  2.025    74.199,00    69.953,00  5,00%
XPT14/01/2025janeiro  2.025    40.249,00    72.101,00  7,00%
XPT15/01/2025janeiro  2.025      2.648,00    21.137,00  2,00%
XPT16/01/2025janeiro  2.025    49.636,00    40.821,00  2,00%
XPT17/01/2025janeiro  2.025    24.274,00    73.968,00  2,00%
XPT18/01/2025janeiro  2.025    49.966,00    66.548,00  1,00%
XPT19/01/2025janeiro  2.025    58.955,00    31.555,00  1,00%
XPT20/01/2025janeiro  2.025    34.177,00    52.315,00  1,00%
XPT21/01/2025janeiro  2.025    59.555,00    54.382,00  1,00%
XPT22/01/2025janeiro  2.025    75.418,00    64.882,00  1,00%
XPT23/01/2025janeiro  2.025    49.651,00    79.643,00  1,00%
XPT24/01/2025janeiro  2.025    14.144,00    28.671,00  1,00%
XPT25/01/2025janeiro  2.025    40.776,00    73.437,00  3,00%
XPT26/01/2025janeiro  2.025    58.190,00    57.633,00  3,00%
XPT27/01/2025janeiro  2.025    69.352,00    35.014,00  1,00%
XPT28/01/2025janeiro  2.025    12.135,00      8.841,00  1,00%
XPT29/01/2025janeiro  2.025    75.996,00    58.154,00  1,00%
XPT30/01/2025janeiro  2.025    42.793,00      5.505,00  1,00%
XPT31/01/2025janeiro  2.025    36.291,00    32.586,00  1,00%
XPT01/02/2025fevereiro  2.025    13.332,00    57.471,00  1,00%

tabela1

NomeDataMês Ano  montante montante 2%
XPTO01/01/2025janeiro  2.025           49.169,00    20.146,00  2,0000%
XPTO02/01/2025janeiro  2.025           30.073,00    78.352,00  2,00%
XPTO03/01/2025janeiro  2.025           16.379,00    21.852,00  2,00%
XPTO04/01/2025janeiro  2.025           76.475,00    26.862,00  2,00%
XPTO05/01/2025janeiro  2.025           79.288,00    25.477,00  2,00%
XPTO06/01/2025janeiro  2.025           78.105,00    44.028,00  2,00%
XPTO07/01/2025janeiro  2.025           46.225,00    53.310,00  2,00%
XPTO08/01/2025janeiro  2.025           43.309,00    65.490,00  1,00%
XPTO09/01/2025janeiro  2.025           40.705,00    20.077,00  2,00%
XPTO10/01/2025janeiro  2.025           34.441,00    18.325,00  3,00%
XPTO11/01/2025janeiro  2.025           24.627,00    22.493,00  7,00%
XPTO12/01/2025janeiro  2.025           49.149,00    36.999,00  8,00%
XPTO13/01/2025janeiro  2.025           65.116,00      6.802,00  5,00%
XPTO14/01/2025janeiro  2.025           10.866,00    30.702,00  7,00%
XPTO15/01/2025janeiro  2.025           64.555,00    10.362,00  2,00%
XPTO16/01/2025janeiro  2.025           20.289,00      7.075,00  2,00%
XPTO17/01/2025janeiro  2.025           78.905,00    32.095,00  2,00%
XPTO18/01/2025janeiro  2.025           67.937,00    40.367,00  1,00%
XPTO19/01/2025janeiro  2.025           16.697,00    26.972,00  1,00%
XPTO20/01/2025janeiro  2.025             6.234,00    27.340,00  1,00%
XPTO21/01/2025janeiro  2.025           64.644,00    42.469,00  1,00%
XPTO22/01/2025janeiro  2.025           63.307,00    17.348,00  1,00%
XPTO23/01/2025janeiro  2.025             2.286,00    15.496,00  1,00%
XPTO24/01/2025janeiro  2.025           69.447,00    60.513,00  1,00%
XPTO25/01/2025janeiro  2.025           53.953,00    57.651,00  3,00%
XPTO26/01/2025janeiro  2.025           25.235,00    67.243,00  3,00%
XPTO27/01/2025janeiro  2.025           67.481,00    18.998,00  1,00%
XPTO28/01/2025janeiro  2.025           43.906,00    55.585,00  1,00%
XPTO29/01/2025janeiro  2.025           61.067,00    61.403,00  1,00%
XPTO30/01/2025janeiro  2.025           46.276,00    19.616,00  1,00%
XPTO31/01/2025janeiro  2.025           13.829,00    24.999,00  1,00%
XPTO01/02/2025fevereiro  2.025           70.977,00    32.246,00  1,00%
1 REPLY 1
DataNinja777
Super User
Super User

Hi @Paulo123 ,

 

In order to achive your required output, it is better to combined the tables 1 and 2 and anotate the source of the table in one column using the append function in Power Query.  This is becasue your table is exactly the same format.  You can then create a calendario table and create a 1:* relationship.  The resultant output is as shown below:

DataNinja777_0-1761669969400.png

I hope this is addressing your paint point.  I attach a pbix file for your reference.


Best regards,

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.