Forum Discussion
Target values do not match between tables
- 6 years ago
Thanks for the sample file, makes everything a lot easier
Is this what you were looking for ?
when you see a column returning all the same value it usually indicates some problem with the filter contextI wrote a measure to store the value of the current product, then use that value to lookup the target direct from the target table
Target Value =VAR current_product = selectedvalue('Product Mix'[Product])var result= lookupvalue(Target[Target Value],Target[Product],current_product)return resultThe filter context is a very powerful tool in DAX, but often you need to escape it... this is one of the reasons for starting to learn how to write measures. Hope this helps.I'm a personal Power Bi Trainer I learn something every time I answer a question
The Golden Rules for Power BI
- Use a Calendar table. A custom Date tables is preferable to using the automatic date/time handling capabilities of Power BI. https://www.youtube.com/watch?v=FxiAYGbCfAQ
- Build your data model as a Star Schema. Creating a star schema in Power BI is the best practice to improve performance and more importantly, to ensure accurate results! https://www.youtube.com/watch?v=1Kilya6aUQw
- Use a small set up sample data when developing. When building your measures and calculated columns always use a small amount of sample data so that it will be easier to confirm that you are getting the right numbers.
- Store all your intermediate calculations in VARs when you’re writing measures. You can return these intermediate VARs instead of your final result to check on your steps along the way.
Thanks for the sample file, makes everything a lot easier
Is this what you were looking for ?
when you see a column returning all the same value it usually indicates some problem with the filter context
I wrote a measure to store the value of the current product, then use that value to lookup the target direct from the target table
I'm a personal Power Bi Trainer I learn something every time I answer a question
The Golden Rules for Power BI
- Use a Calendar table. A custom Date tables is preferable to using the automatic date/time handling capabilities of Power BI. https://www.youtube.com/watch?v=FxiAYGbCfAQ
- Build your data model as a Star Schema. Creating a star schema in Power BI is the best practice to improve performance and more importantly, to ensure accurate results! https://www.youtube.com/watch?v=1Kilya6aUQw
- Use a small set up sample data when developing. When building your measures and calculated columns always use a small amount of sample data so that it will be easier to confirm that you are getting the right numbers.
- Store all your intermediate calculations in VARs when you’re writing measures. You can return these intermediate VARs instead of your final result to check on your steps along the way.
- Anonymous6 years agoNot applicable
kentylerthat's it! thank you!
Boy do I still have a lot to learn when it comes to DAX and measures. Got to start studying up on the VAR function.
thanks again.
- kentyler6 years agoSolution Sage
depending on how your head works... take a look at the free lessons and other material on sqlbi.com
or look at avi sing's learnpowerbi videos on youtube
or search on youtube for curbal