Forum Discussion
Calculate No Payment Last 2 rolling weeks
- 9 years ago
There is probably a better formula for this but this should work
Trial1 = IF(ISBLANK( CALCULATE(COUNTROWS(Table1),DATESBETWEEN(DateTable[date],TODAY()-14,TODAY())))
,2,
MOD(CALCULATE(COUNTROWS(Table1),DATESBETWEEN(DateTable[date],TODAY()-14,TODAY())),2))
HI Greg_Davurse
I recommend you look at pivoting your table for Power BI.
I suggest the following format (which can be done in the Query Editor)
Employee No, Date , Payment
Bill , Jan 7 , 112
Bill , Jan 21 , 124
Bill , Feb 25 , 300
James , Jan 21 , 123
...
...
Once you have the data in this format, you can create a relationship to a Calendar table on the Date column and you'll find the measures much easier to create. We can help with that if need.
Phil
- Greg_Davurse9 years ago
Helper I
Hi Phil_Seamark,
Thanks for the reply. The data is actually already in that format. The image of the Pivot Table you see is an example of the matrix I have in my PBI model. With that being said, I also have a Calendar table that has a relationship to the Employee Paid table (which contains the data you see in the matrix). Further thoughts?
Thanks,
Greg