Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Community,
What's the better way to create a calculated column for qtd, ytd, mtd. etc?
We're creating a calculated column for qtd with query like below:
qtd = calculate(sum(value),filter(table_name, quarter = eariler(quarter)&&year = eariler(year)))
It raised an error message:
There's not enough memory to process this operation.
The size of pbix is 203M. So, can we find a better method to create this calculated column like using qtd, mtd function?
Best Regards,
Teige
Solved! Go to Solution.
Hi @Teige_Gao ,
Calculated columns take up memory, while measures take up CPU.
DAX has built-in function TOTALQTD, TOTALMTD, TOTALYTD to calculate QTD, MTD, YTD, please refer to: https://msdn.microsoft.com/en-us/query-bi/dax/time-intelligence-functions-dax. For more details about when to use these functions and how to use these functions, please refer to: https://www.mssqltips.com/sqlservertip/4841/calculating-mtd-qtd-ytd-running-and-cumulative-total-in-....
Also please filter your resource table, and just load the necessary data. There are some tips about managing Memory, you can review them in this similar thread.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Teige_Gao ,
Calculated columns take up memory, while measures take up CPU.
DAX has built-in function TOTALQTD, TOTALMTD, TOTALYTD to calculate QTD, MTD, YTD, please refer to: https://msdn.microsoft.com/en-us/query-bi/dax/time-intelligence-functions-dax. For more details about when to use these functions and how to use these functions, please refer to: https://www.mssqltips.com/sqlservertip/4841/calculating-mtd-qtd-ytd-running-and-cumulative-total-in-....
Also please filter your resource table, and just load the necessary data. There are some tips about managing Memory, you can review them in this similar thread.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for you replyment
@Teige_Gao this seems like a different problem, shouldn't take that long, the calculated column is not going to be the solution, let's be very clear on this. The measure is a way to go.
Do you have a date dimension in your model?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Teige_Gao why do you want a column? Why measure will not work?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks for reply, measure is not work in my scenario, the data granularity is qtd, ytd, mtd. etc. But based on the organization data management standard, we can't calculate them in database, as a result, we need to calculate them in PBI end. But if we use measure, it takes more than 10s to refresh a report.
User | Count |
---|---|
128 | |
108 | |
100 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |