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.
I am using the below function to calculate the 12 month running total of items.
When all the periods are listed every thing works great. However if I filter and a period is missing a MYSTERIOUS "2" appears in the data.
CompRunning_alt =
VAR CompCount =
CALCULATE (
DISTINCTCOUNT( 'Extract (Header)'[issueNumber]),
DATESINPERIOD (
'Extract (Header)'[Month],
MAX ('Extract (Header)'[Month] ),
-12,
MONTH
)
)
RETURN
CompCount
All Months
With missi
Solved! Go to Solution.
I was able to resolve the issue by adding a seperate date table and not use the date in the main table. I do not know why this fixed the problem or why PBI was putting a MYSTERIOUS 2 when it should have been Null or Zero.
I was able to resolve the issue by adding a seperate date table and not use the date in the main table. I do not know why this fixed the problem or why PBI was putting a MYSTERIOUS 2 when it should have been Null or Zero.
Hi,
I assume that Items is a measure which is calculated as = DISTINCTCOUNT( 'Extract (Header)'[issueNumber]). If my understanding is correct, then how can you add distinctcount entries. By its very nature, distinctcount cannot be additive.
@ptk10636 very hard to tell without looking at the pbix file, can you share it, remove sensitive info before sharing.
Also as a best practice, do all time-based calculation using date dimension, means you should add a date dimension in your model to make it work.
here is a blog post that talks about how to add a date dimension to 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.
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |