Forum Discussion
Do I need variables?
Hello folks,
New BI user here but not new to analysis. I'm trying to transition myself into BI and out of Excel as I have reached the limits if Excel with the work that I do but I am hampered by the varrying syntax between the two. I exclusively used dynamic tables in Excel so referencing tables and columns is no problem for me.
So my problem:
I'm trying to find the sum of one column based on a row value and divide that with sum of another column based on that same row value. In Excel, I would typically just use =SUMIFS(xxxxx)/SUMIFS(xxxxx) The overall lfunction will be more indepth and complex than that because I will build in dates and trends over dates into it at some point but I need to start with the basics.
Here is where I am stuck:
5 Replies
- adambhappyResolver II
Why are you using SUMX() for this particular exercise instead of just a simple CALCULATE() with a SUM() inside? The filtering you do doesn't seem to require that the formula is evaulated at row context.
- mikebravoRegular Visitor
Ignorance possibly..?? ;) In earlier trials, I was using CALCULATE and SUM with FILTER and EARLIER. This is a simplified version as there will be 3 criteria for each function so I thought maybe I shoudl use SUMX.
- adambhappyResolver II
The context transition is one of the hardest things to get your head around in terms of DAX, it takes a while so not surprising.
Can you share a print screen of your tables and maybe a small sample set of the data?
Can I assume that [Dist] and [Totalfuel] refers to measures and not columns?