Forum Discussion
latest value text
- Anonymous6 years ago
Hi Anonymous ,
You can create two measures as below, then create a bar chart with Product Level field on Axis fields and new measure “CountofPlevel" on Values field:
NProduct Level = VAR _maxdate = CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( ALL ( 'Table' ), 'Table'[Product ID] = MAX ( 'Table'[Product ID] ) ) ) RETURN CALCULATE ( MAX ( 'Table'[Product Level] ), FILTER ( ALL ( 'Table' ), 'Table'[Product ID] = MAX ( 'Table'[Product ID] ) && 'Table'[Date] = _maxdate ) )CountofPlevel = VAR _tab = SUMMARIZE ( 'Table', 'Table'[Product ID], "Npl", [NProduct Level] ) RETURN COUNTROWS ( FILTER ( _tab, [Npl] = MAX ( 'Table'[Product Level] ) ) )Best Regards
Rena
Anonymous , Try
countx(filter(summarize(Table,table[user], table[product],table[Product Level],"_1", calculate(lastnonblankvalue(table[LevelDate],max(Table[Product Leve])),allexcept(Table,table[user], table[product]))) ,[_1] =[Product Level]),[product])
amitchandak thank you for this am i able to do a distinct count of this as we have multiple products Ids that are the same so only want to look at them onces as looking at that i have some 2's when doing a count against the Outlet IDs
- Anonymous6 years agoNot applicable
Hi Anonymous ,
You can create two measures as below, then create a bar chart with Product Level field on Axis fields and new measure “CountofPlevel" on Values field:
NProduct Level = VAR _maxdate = CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( ALL ( 'Table' ), 'Table'[Product ID] = MAX ( 'Table'[Product ID] ) ) ) RETURN CALCULATE ( MAX ( 'Table'[Product Level] ), FILTER ( ALL ( 'Table' ), 'Table'[Product ID] = MAX ( 'Table'[Product ID] ) && 'Table'[Date] = _maxdate ) )CountofPlevel = VAR _tab = SUMMARIZE ( 'Table', 'Table'[Product ID], "Npl", [NProduct Level] ) RETURN COUNTROWS ( FILTER ( _tab, [Npl] = MAX ( 'Table'[Product Level] ) ) )Best Regards
Rena