Forum Discussion
619SK
2 years agoHelper II
Power Query formula for calculating if condition and calculate count from another table
Hi I have around 20+ controls from each sharepoint, i need to calculate count with open status and give point as per ageing per the rules. i have appended all 20+ control into 1 table with two colu...
- 2 years ago
619SK I put this solution together. Might be correct I suppose. I did some things in Power Query but the rest is DAX. See PBIX attached below signature. Really the only Power Query is unpivoting your point logic columns.
Open = VAR __AgeCategory = MAX( 'PointLogic'[Attribute] ) VAR __Table = ADDCOLUMNS( 'Table', "AgeCategory", SWITCH( TRUE(), [Ageing] < 16, "0-15", [Ageing] < 31, "16-30", [Ageing] < 91, "31-90", ">90" ) ) VAR __Result = COUNTROWS( FILTER( __Table, [AgeCategory] = __AgeCategory ) ) + 0 RETURN __result Points = VAR __Open = [Open] VAR __AgeCategory = MAX( 'PointLogic'[Attribute] ) VAR __Result = MAXX( FILTER( 'PointLogic', [No of Count] = __Open && [Attribute] = __AgeCategory ), [Value] ) RETURN __Result
619SK
2 years agoHelper II
Thanks Greg_Deckler its working , I will make few changes in my real scenerio where logic is upto 400+ count.