Forum Discussion
Using column name in calculated column. Dax equivalent to table.columnnames.
- 4 years ago
I eventually did have to unpivot the table and referenced the table in order to be able to use the values. It does not feel like the best solution but it does work.
I eventually did have to unpivot the table and referenced the table in order to be able to use the values. It does not feel like the best solution but it does work.
- daXtreme4 years ago
Solution Sage
Well, unpivoting the first table is what Power BI really wants 🙂 To know how to structure your models to be GOOD (wide and short dimensions, narrow and long facts), please read this article by Microsoft: Understand star schema and the importance for Power BI … (bing.com)
- Nathalie124 years agoFrequent Visitor
I know, I was just struggling with it because I didn't really want to have these extra dates in my model, because I'm not really sure how to connect these to my date table and I would only need these couple dates as a condition in one if statement. I could do this manually but then it would have to be changed manually each when new columns are added, so I was hoping I could use a function like table.columnnames to get those values automatically. This method could work within Power Query but because the values are divided over two related tables this was unfortunately not possible.
I still don't really know if what I currently have is correct because I now have in both of these two tables a start and enddate, so connecting with the date table is difficult. For the price table I now have an active relationship with the start date and an inactive for the end date, because I don't need that as much.- daXtreme4 years ago
Solution Sage
If you don't know if what you have is correct and you've got duplication in your model... then I think you really should take some time to understand what data modeling is all about. I've already pointed you in the right direction in my prior reply. Please read the article about the importance of star schema for Power BI. I promise it'll be enlightening.