Forum Discussion
Anonymous
6 years agoNot applicable
latest value text
I am trying to create the below table; i have the following data; IdUsernameProduct IDProduct LevelDate 1 John 1 High 06 February 2020 2 John 1 Low 07 February 2020 3 J...
- 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
6 years agoNot applicable
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
Anonymous
6 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