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.
Hi Community.
I am looking to DAX formula that returns the text value that related to the range from another table.
I have 1st table with wll company accounts in it, 2nd table with accounts ranges (Start account, End account) and related indicator to the range. I need to bring indicator name from 2nd table to the 1st table.
This if formula does not work for account numbers "in between" the range or simply if account # from the 1st table does not match to the Start Account # from the 2nd table.
You can load pbix test file
https://drive.google.com/drive/folders/1UmYcl7frXv347k1nOs4lVxvvW2QeaHxO
Thank you.
Solved! Go to Solution.
First off, thanks for including the PBIX file, that really helped as I couldn't fully understand what you were trying to achieve by your question! 🙂
You don't need a relationship between the tables. I hope I understood your question correctly. My understanding is that you want to have a calculated column in table "Account" which reflects which indicator belongs to the account number. Indicators are given in the "Indicator" column with a start value and end value, and when an account number in the "account" table is equal to start or end or is in between that value, you want that corresponding Indicator to the account table.
This is the dax that does just that:
Indicator = CALCULATE(SELECTEDVALUE(Indicator[Indicator]), FILTER(ALL(Indicator), Indicator[StartAccount] <= Account[Account] && Indicator[EndAccount] >= Account[Account]))
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Proud to be a Super User!
First off, thanks for including the PBIX file, that really helped as I couldn't fully understand what you were trying to achieve by your question! 🙂
You don't need a relationship between the tables. I hope I understood your question correctly. My understanding is that you want to have a calculated column in table "Account" which reflects which indicator belongs to the account number. Indicators are given in the "Indicator" column with a start value and end value, and when an account number in the "account" table is equal to start or end or is in between that value, you want that corresponding Indicator to the account table.
This is the dax that does just that:
Indicator = CALCULATE(SELECTEDVALUE(Indicator[Indicator]), FILTER(ALL(Indicator), Indicator[StartAccount] <= Account[Account] && Indicator[EndAccount] >= Account[Account]))
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |