Forum Discussion
Creating measures based on different deadline dates
Hi,
Many thanks for your help. I am almost there but i have a problem when splitting the numbers by month and i have pasted the relevant detail below. Any advice would be appreciated.
Hi PaisleyPrince ,
Thanks for sharing the additional details and the screenshot.
The issue appears to come from deriving the month inside the measure using the deadline date. When Month is placed on the visual, the month calculated from the deadline date overrides the month coming from the Date table, which leads to incorrect results when splitting the values by month.
To avoid this, the month should always come from the Date table. The department deadline should be used only as a cutoff day within the selected month, not to determine the month itself.
One approach is to take the year and month from the Date table and then construct the deadline date for each department within that month before comparing it with the invoice posting date.
A measure pattern would look like this:
Invoices Posted =
VAR SelectedYear =
YEAR ( MIN ( 'Date'[Date] ) )
VAR SelectedMonth =
MONTH ( MIN ( 'Date'[Date] ) )
VAR DeadlineDay =
MAX ( Division_DM[Deadline Day] )
VAR DeadlineDate =
DATE ( SelectedYear, SelectedMonth, DeadlineDay )
RETURN
CALCULATE (
COUNTROWS ( Invoices ),
Invoices[PostedDate] <= DeadlineDate
)
If this still does not behave as expected in your model, please share a sample PBIX file or sample data. That will help in understanding the setup better and providing more targeted guidance.
You could upload your file to a cloud storage (like OneDrive, Dropbox, Google Drive or Wetransfer for example) and paste the link here.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you.
- PaisleyPrince7 months agoAdvocate II
Hi,
thanks for your response. Unfortunately it still provides an incorrect split when it comes to getting values by month. I will look to provide some sample data and upload a file shortly.
Regards
Scott
- v-veshwara-msft7 months agoCommunity Support
Hi PaisleyPrince ,
We wanted to kindly follow up regarding your query. If you need any further assistance, please reach out.Could you please share sample data or PBIX file for better guidance. You could upload your file to a cloud storage (like OneDrive, Dropbox, Google Drive or Wetransfer for example) and paste the link here.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you.
- v-veshwara-msft7 months agoCommunity Support
Hi PaisleyPrince ,
Just wanted to check if the response provided was helpful. If further assistance is needed, please reach out and could you please share sample data or PBIX file for better guidance. You could upload your file to a cloud storage (like OneDrive, Dropbox, Google Drive or Wetransfer for example) and paste the link here.How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you.