Forum Discussion
How to calculate higher value for same dates on user level
- Anonymous3 years ago
Hi NebojsaZ88 ,
Please refer to my pbix file to see if it helps you.
Create measures.
Measure = IF ( MAX ( [Group rank] ) = CALCULATE ( MAX ( 'Table'[Group rank] ), FILTER ( ALL ( 'Table' ), [weekending] = SELECTEDVALUE ( 'Table'[weekending] ) ) ), 1, 0 )Measure2 = VAR _b = SUMMARIZE ( 'Table', 'Table'[weekending], "aaa", [Measure] ) RETURN IF ( HASONEVALUE ( 'Table'[weekending] ), [Measure], SUMX ( _b, [aaa] ) )Or create a column.
Column = IF ( [Group rank] = CALCULATE ( MAX ( 'Table'[Group rank] ), FILTER ( 'Table', [weekending] = EARLIER ( 'Table'[weekending] ) ) ), 1, 0 )If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi NebojsaZ88 ,
Please refer to my pbix file to see if it helps you.
Create measures.
Measure =
IF (
MAX ( [Group rank] )
= CALCULATE (
MAX ( 'Table'[Group rank] ),
FILTER ( ALL ( 'Table' ), [weekending] = SELECTEDVALUE ( 'Table'[weekending] ) )
),
1,
0
)
Measure2 =
VAR _b =
SUMMARIZE ( 'Table', 'Table'[weekending], "aaa", [Measure] )
RETURN
IF ( HASONEVALUE ( 'Table'[weekending] ), [Measure], SUMX ( _b, [aaa] ) )
Or create a column.
Column =
IF (
[Group rank]
= CALCULATE (
MAX ( 'Table'[Group rank] ),
FILTER ( 'Table', [weekending] = EARLIER ( 'Table'[weekending] ) )
),
1,
0
)
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
With small changes (ALLEXCEPT instead of ALL) I managed to get result + I added into FILTER User ID as my table contains 1000+ unique users (I just show here example for one). Overall, good guidance to what I wanted, so thank you. 👌
Measure =
IF (
MAX ('Table'[Group rank]) =
CALCULATE (
MAX ('Table'[Group rank]),
FILTER (ALLEXCEPT('Table','Table'[Week Ending]), 'Table'[User ID] = SELECTEDVALUE('Table'[User ID]))),1,0)
But, with second measure, I have result i wanted for matrix viz, but when I want to show as chart (live printscreen below) and in Y-axis put measure 2, there is no values, why?