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.
In my model I have a calculated column used to find the creation date of an entry number on the table 'G/L Entry'. The date is located on the table 'G/L Register'.
My formula is a follows:
What about this:
[Creation Date] = -- column in 'G/L Entry' var _entryNumber = 'G/L Entry'[Entry No] return CALCULATE( MAX( 'G/L Register[Creation Date] ), 'G/L Register'[From Entry No_] <= __entryNumber, __entryNumber <= 'G/L Register'[To Entry No_] )
First, I understand that the intervals [[From Entry No_], [To Entry No_]] are ranges that cover the whole range and are non-overlapping. Second, I understand there's no relationship set up between the two tables. But if there is, for instance, 'G/L Entry' has a many-to-one relationship with 'G/L Register' (as I think it should have since one entry can easily map into just one record in 'G/L Register' that the entry number belongs to), then the measure would be different and potentially much, much faster:
[Creation Date] = CALCULATE( MAX( 'G/L Register[Creation Date] ) )
Best
Darek
Hi @Anonymous ,
Thank you for your response.
I have tried your first suggestion, however this takes up all memory.
You are right about your assumptions. There is no relationship between 'G/L Entry' and 'G/L Register'. Perhaps I could create a key to map the Entry No from G/L Entry to the range number that it belongs to in G/L Register?
By the way, if you create the relationship, then you can use this (the fastest option with DAX):
[Creation Date] = RELATED( 'G/L Register[Creation Date] )
Best
Darek
Sounds great. However right now I am struggling with the creation of a key to map the entry no with the number on G/L Register that represents the relevant range.
You should do it in PowerQuery and I assume this is what you do. Certainly, there are myriads of articles on the net about how to do this as it must be a very common thing to do in PQ. Just a matter of a good search...
Best
Darek
No luck so far... 🙂
But thanks for your inputs.
If in trouble, please find the relevant forum on PowerQuery and post your question. You can also try people like Chris Webb, Marco Russo, Matt Arlington...
Best
Darek
Yes, you absolutely should if you can. Calculations based on physical relationships are 10-100x faster than without them.
But you also could create the column in your ETL layer, which would be the best solution possible.
Best
Darek
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 |
---|---|
49 | |
26 | |
21 | |
16 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |