March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have the below matrix of invoices on hold for 2 months of data so far.
I have calcualated the "Delta" as the change from previous month. There is no data for July so the result of the calculation for August is the same as the number of invoices.
In the total column, somehow my Dax is counting the nubmer of invoices instead of the number of invoices last month. For exmple the first row of the matrix the total column for Delta under the heading "Avg Number" reads "10947" which is the sum of the number of invoices for Aug and Sept(4125+6822).
The Dax is below. Why is this happening and how do I get my Dax to count the number of invoices last month for each month, in the total column?
Mark Janecek
PTP Metrics Analyst
Johsn
Solved! Go to Solution.
Hi @Anonymous,
Measures are calculated based on context so in this case when you go to the total value of your measure you are not making the average but in fact you are making the calculation of the total invoices - previous month total invoices are the two months and previous is 0 becuase there are no values.
In this case you need to add a AVERAGEX in order to achieve what you need should be something similar to:
AVERAGE = IF (HASONEVALUE(Table[Monthyear]), [Delta], AVERAGEX(VALUES(Table[Monthyear]), [Delta]))
Be aware that depending on your model this may need some adjustments
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Anonymous,
Measures are calculated based on context so in this case when you go to the total value of your measure you are not making the average but in fact you are making the calculation of the total invoices - previous month total invoices are the two months and previous is 0 becuase there are no values.
In this case you need to add a AVERAGEX in order to achieve what you need should be something similar to:
AVERAGE = IF (HASONEVALUE(Table[Monthyear]), [Delta], AVERAGEX(VALUES(Table[Monthyear]), [Delta]))
Be aware that depending on your model this may need some adjustments
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank You Miguel, That worked great!
Hi @Anonymous
Glad I could help don't forget to mark the correct answer so it can help other users.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |