Forum Discussion
Anonymous
6 years agoNot applicable
Calculating the no. tripled values within 12 weeks
Hello I am currently investigating a dataset that contains the following columns below. The table refers to a series of assets that appear in a dataset if they have been verified to have failed ...
- 6 years ago
Hi Anonymous ,
Create 2 measures as below:
Measure = var _totalrows=CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Asset ID]=MAX('Table'[Asset ID]))) var _mindate=MINX(FILTER(ALL('Table'),'Table'[Asset ID]=MAX('Table'[Asset ID])&&'Table'[Date of entry]<MAX('Table'[Date of entry])),'Table'[Date of entry]) var c=DATEDIFF(_mindate,MAX('Table'[Date of entry]),WEEK) Return IF(_totalrows>=3 && c<12,"repeat error",BLANK())Repeat error = var a =CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Asset ID]=MAX('Table'[Asset ID]))) var b=CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Asset ID]=MAX('Table'[Asset ID])&&'Table'[Measure]<>BLANK())) var c=IF(a>=3&&a-b<2,1,0) Return SUMX(FILTER(ALL('Table'),'Table'[Asset ID]=MAX('Table'[Asset ID])),c)Finally you will see:
For the related .pbix file,pls click here.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
amitchandak
Super User
6 years agoAnonymous
With help of date table and week Rank you can get 12 week data like this
Last 12 week Sales = CALCULATE(Count(Table[Asset ID]),FILTER(all('Date'),'Date'[Week Rank]>=min('Date'[Week Rank])-12 && 'Date'[Week Rank]<=max('Date'[Week Rank])))
You can filter on > 3
Refer, how to deal with the week