The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I have a table inculing these two columns:
column1: the date when the item was created
column2: the date the item was finalized
Now I would like to display the monthly totals of the Items in process (column1<= Last Day of Month < column2) so I get the number of items which where already created at the end of the certain month, but not yet finalized.
I'd like to create a bargraph that shows me this amount for each month.
How can I do this?
Thank you in advance for your help, I stuck in this task since a long time
I have the same question as @ImkeF. Does one item span multiple months?
If not, you can use a full calendar date table, build the relationship with this Table on column1, create a calculated column to tag if current item is finished in current month.
IsFinished in Current Month= IF(Table[column1] <= EOMONTH(Date[Date],0) && Table[column2] > EOMONTH(Date[Date],0), 1 ,0 )
Then count the items where IsFinished in Current Month is 1.
If one item can span multiple months, it will be more compliated. You need to have each item cross join your data table. Then compare if current date within the range between column 1 and column 2. If count of "Within Range" equals the count of days within current month, this item will be counted as 1, otherwise it will be counted as 0.
Regards,
Thanks for your reply,
how can I do the cross join for each item?
Will there always be just one month end in between or could they also span multiple months?
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi ImkeF,
they can span multiple months.
You might find a suitable solution here: http://www.sqlbi.com/articles/analyzing-events-with-a-duration-in-dax/
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
180 | |
88 | |
71 | |
48 | |
46 |