Forum Discussion
Create measure using 2 columns
- 1 year ago
Hi Anonymous - I think you donyt have any relationship between rate and date table, follow the below
create a measure as :
Selected Year Rate =
VAR SelectedYear = SELECTEDVALUE('Date'[Year]) -- Year selected from Date table
RETURN
CALCULATE(
MAX('RateTable'[Rate]), -- Replace 'RateTable' with your actual table name
FILTER(
'RateTable',
'RateTable'[Year] = SelectedYear
)
)Let me know if this solution works for your scenario!
Hi Anonymous
To create a measure that displays the Rate for the selected Year,you can follow these steps:
1).Ensure that your date table has a relationship with the table containing the Year and Rate columns.
2).Create a new measure in Power BI with the following DAX formula:
Selected Year Rate =
VAR SelectedYear = SELECTEDVALUE('DateTable'[Year])
RETURN
CALCULATE(
MAX('YourTableName'[Rate]),
'YourTableName'[Year] = SelectedYear
)
Note:- Make sure to replace 'YourTableName' with the actual name of your table and 'DateTable'
with the name of your date table.
You can now use this measure in a card visual.
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.