Forum Discussion

IF's avatar
IF
Icon for Post Prodigy rankPost Prodigy
5 years ago

3 month rolling -text type date

Hi,

I posted this a month ago. However, I realized that I need to use the "month.year" column in text format.

Link: https://community.powerbi.com/t5/Desktop/3-month-rolling-count/td-p/1642549

 

I have "month.year" column in text format and in a different table. I have type also in another table. I use "type" and "month.year" from its own table as slicers. Based on the selection, I want to count the number of records for the last 3 months. You can download the files. the measure below works when the month selection is in date format. However, I need to use it in text format since some other pages changes when I change the type format.

 

selected type moving count =
CALCULATE(COUNTROWS('Main'),FILTER(ALL(Main),'Main'[dateselection]<=SELECTEDVALUE('Month'[Month])&&'Main'[dateselection]>=CALCULATE(MIN('Month'[Month]),DATEADD('Month'[Month],-2,MONTH))&&'Main'[type]=SELECTEDVALUE('Type'[type])))

 

Thanks in advance.

 

 

6 Replies