Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
tabela 2
| Nome | Data | Mês | Ano | montante | montante 2 | % |
| XPT | 01/01/2025 | janeiro | 2.025 | 74.818,00 | 33.855,00 | 2,0000% |
| XPT | 02/01/2025 | janeiro | 2.025 | 23.229,00 | 13.610,00 | 2,00% |
| XPT | 03/01/2025 | janeiro | 2.025 | 77.146,00 | 2.829,00 | 2,00% |
| XPT | 04/01/2025 | janeiro | 2.025 | 66.510,00 | 3.429,00 | 2,00% |
| XPT | 05/01/2025 | janeiro | 2.025 | 63.691,00 | 9.317,00 | 2,00% |
| XPT | 06/01/2025 | janeiro | 2.025 | 51.566,00 | 50.442,00 | 2,00% |
| XPT | 07/01/2025 | janeiro | 2.025 | 11.099,00 | 71.748,00 | 2,00% |
| XPT | 08/01/2025 | janeiro | 2.025 | 33.103,00 | 16.988,00 | 1,00% |
| XPT | 09/01/2025 | janeiro | 2.025 | 34.406,00 | 70.820,00 | 2,00% |
| XPT | 10/01/2025 | janeiro | 2.025 | 43.854,00 | 42.044,00 | 3,00% |
| XPT | 11/01/2025 | janeiro | 2.025 | 18.502,00 | 30.935,00 | 7,00% |
| XPT | 12/01/2025 | janeiro | 2.025 | 51.686,00 | 25.897,00 | 8,00% |
| XPT | 13/01/2025 | janeiro | 2.025 | 74.199,00 | 69.953,00 | 5,00% |
| XPT | 14/01/2025 | janeiro | 2.025 | 40.249,00 | 72.101,00 | 7,00% |
| XPT | 15/01/2025 | janeiro | 2.025 | 2.648,00 | 21.137,00 | 2,00% |
| XPT | 16/01/2025 | janeiro | 2.025 | 49.636,00 | 40.821,00 | 2,00% |
| XPT | 17/01/2025 | janeiro | 2.025 | 24.274,00 | 73.968,00 | 2,00% |
| XPT | 18/01/2025 | janeiro | 2.025 | 49.966,00 | 66.548,00 | 1,00% |
| XPT | 19/01/2025 | janeiro | 2.025 | 58.955,00 | 31.555,00 | 1,00% |
| XPT | 20/01/2025 | janeiro | 2.025 | 34.177,00 | 52.315,00 | 1,00% |
| XPT | 21/01/2025 | janeiro | 2.025 | 59.555,00 | 54.382,00 | 1,00% |
| XPT | 22/01/2025 | janeiro | 2.025 | 75.418,00 | 64.882,00 | 1,00% |
| XPT | 23/01/2025 | janeiro | 2.025 | 49.651,00 | 79.643,00 | 1,00% |
| XPT | 24/01/2025 | janeiro | 2.025 | 14.144,00 | 28.671,00 | 1,00% |
| XPT | 25/01/2025 | janeiro | 2.025 | 40.776,00 | 73.437,00 | 3,00% |
| XPT | 26/01/2025 | janeiro | 2.025 | 58.190,00 | 57.633,00 | 3,00% |
| XPT | 27/01/2025 | janeiro | 2.025 | 69.352,00 | 35.014,00 | 1,00% |
| XPT | 28/01/2025 | janeiro | 2.025 | 12.135,00 | 8.841,00 | 1,00% |
| XPT | 29/01/2025 | janeiro | 2.025 | 75.996,00 | 58.154,00 | 1,00% |
| XPT | 30/01/2025 | janeiro | 2.025 | 42.793,00 | 5.505,00 | 1,00% |
| XPT | 31/01/2025 | janeiro | 2.025 | 36.291,00 | 32.586,00 | 1,00% |
| XPT | 01/02/2025 | fevereiro | 2.025 | 13.332,00 | 57.471,00 | 1,00% |
tabela1
| Nome | Data | Mês | Ano | montante | montante 2 | % |
| XPTO | 01/01/2025 | janeiro | 2.025 | 49.169,00 | 20.146,00 | 2,0000% |
| XPTO | 02/01/2025 | janeiro | 2.025 | 30.073,00 | 78.352,00 | 2,00% |
| XPTO | 03/01/2025 | janeiro | 2.025 | 16.379,00 | 21.852,00 | 2,00% |
| XPTO | 04/01/2025 | janeiro | 2.025 | 76.475,00 | 26.862,00 | 2,00% |
| XPTO | 05/01/2025 | janeiro | 2.025 | 79.288,00 | 25.477,00 | 2,00% |
| XPTO | 06/01/2025 | janeiro | 2.025 | 78.105,00 | 44.028,00 | 2,00% |
| XPTO | 07/01/2025 | janeiro | 2.025 | 46.225,00 | 53.310,00 | 2,00% |
| XPTO | 08/01/2025 | janeiro | 2.025 | 43.309,00 | 65.490,00 | 1,00% |
| XPTO | 09/01/2025 | janeiro | 2.025 | 40.705,00 | 20.077,00 | 2,00% |
| XPTO | 10/01/2025 | janeiro | 2.025 | 34.441,00 | 18.325,00 | 3,00% |
| XPTO | 11/01/2025 | janeiro | 2.025 | 24.627,00 | 22.493,00 | 7,00% |
| XPTO | 12/01/2025 | janeiro | 2.025 | 49.149,00 | 36.999,00 | 8,00% |
| XPTO | 13/01/2025 | janeiro | 2.025 | 65.116,00 | 6.802,00 | 5,00% |
| XPTO | 14/01/2025 | janeiro | 2.025 | 10.866,00 | 30.702,00 | 7,00% |
| XPTO | 15/01/2025 | janeiro | 2.025 | 64.555,00 | 10.362,00 | 2,00% |
| XPTO | 16/01/2025 | janeiro | 2.025 | 20.289,00 | 7.075,00 | 2,00% |
| XPTO | 17/01/2025 | janeiro | 2.025 | 78.905,00 | 32.095,00 | 2,00% |
| XPTO | 18/01/2025 | janeiro | 2.025 | 67.937,00 | 40.367,00 | 1,00% |
| XPTO | 19/01/2025 | janeiro | 2.025 | 16.697,00 | 26.972,00 | 1,00% |
| XPTO | 20/01/2025 | janeiro | 2.025 | 6.234,00 | 27.340,00 | 1,00% |
| XPTO | 21/01/2025 | janeiro | 2.025 | 64.644,00 | 42.469,00 | 1,00% |
| XPTO | 22/01/2025 | janeiro | 2.025 | 63.307,00 | 17.348,00 | 1,00% |
| XPTO | 23/01/2025 | janeiro | 2.025 | 2.286,00 | 15.496,00 | 1,00% |
| XPTO | 24/01/2025 | janeiro | 2.025 | 69.447,00 | 60.513,00 | 1,00% |
| XPTO | 25/01/2025 | janeiro | 2.025 | 53.953,00 | 57.651,00 | 3,00% |
| XPTO | 26/01/2025 | janeiro | 2.025 | 25.235,00 | 67.243,00 | 3,00% |
| XPTO | 27/01/2025 | janeiro | 2.025 | 67.481,00 | 18.998,00 | 1,00% |
| XPTO | 28/01/2025 | janeiro | 2.025 | 43.906,00 | 55.585,00 | 1,00% |
| XPTO | 29/01/2025 | janeiro | 2.025 | 61.067,00 | 61.403,00 | 1,00% |
| XPTO | 30/01/2025 | janeiro | 2.025 | 46.276,00 | 19.616,00 | 1,00% |
| XPTO | 31/01/2025 | janeiro | 2.025 | 13.829,00 | 24.999,00 | 1,00% |
| XPTO | 01/02/2025 | fevereiro | 2.025 | 70.977,00 | 32.246,00 | 1,00% |
Solved! Go to Solution.
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:
I hope this is addressing your paint point. I attach a pbix file for your reference.
Best regards,
Latest Montante 2 =
VAR MaxDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
MAX('YourTable'[Montante 2]),
FILTER(
ALL('YourTable'),
'YourTable'[Date] <= MaxDate
)
)
For multiple tables, create this measure in each table and use UNION or SWITCH logic to select the relevant one based on your context.
If this answer helped, please click Kudos or mark as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
Latest Montante 2 =
VAR MaxDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
MAX('YourTable'[Montante 2]),
FILTER(
ALL('YourTable'),
'YourTable'[Date] <= MaxDate
)
)
For multiple tables, create this measure in each table and use UNION or SWITCH logic to select the relevant one based on your context.
If this answer helped, please click Kudos or mark as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
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:
I hope this is addressing your paint point. I attach a pbix file for your reference.
Best regards,
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |