Forum Discussion
Measuring time between dates in the past
- Anonymous3 years ago
Hi Tomhayw ,
The project 3 should not be included due to the invoice paid on Feb 07, 2022... Am I right? I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:
Measure = VAR _year = SELECTEDVALUE ( 'Date'[Date].[Year] ) VAR _month = SELECTEDVALUE ( 'Date'[Date].[MonthNo] ) VAR _seledate = EOMONTH ( DATE ( _year, _month, 1 ), 0 ) VAR _count = CALCULATE ( DISTINCTCOUNT ( 'Table'[Project name] ), FILTER ( 'Table', 'Table'[Invoice sent] < _seledate && 'Table'[Invoice paid] > _seledate && DATEDIFF ( 'Table'[Invoice sent], _seledate, DAY ) > 30 ) ) RETURN _countBest Regards
Hi Tomhayw ,
Please remove the relationship between your fact table and Datedim table, and check if you can get the correct result. If no, please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file without sensitive info. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi thanks,
This seems to have worked but I really need a relationship between the date and fact table as I am undertaking other analysis on this dataset. Is there a way I can incorporate both?
Thanks.
- Anonymous3 years agoNot applicable
Hi Tomhayw ,
You can consider to create another date dimension table and don't create any relationship with your fact table. And apply the date field onto your visual to replace the original date field...
If it still not working, could you please share a simplified pbix file with me? You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards