Forum Discussion
Dhrutivyasa-070
3 years agoHelper I
DAX
Hello Community, I have one Taste Rating dataset which contains following column. I want to compare one primary taster rating with other taster. and i want to slicer for taster name. One is for pr...
- 3 years ago
Hi Dhrutivyasa-070
Please refer to attached sample file with the proposed solution.Number of Lot Tasted = VAR PrimaryTaster = SELECTEDVALUE ( Tasters[Primary Taster] ) VAR Taster = SELECTEDVALUE ( 'Table'[TasterName], PrimaryTaster ) RETURN IF ( Taster <> PrimaryTaster, SUMX ( VALUES ( 'Table'[UniqueID] ), INT ( PrimaryTaster IN CALCULATETABLE ( VALUES ( 'Table'[TasterName] ), ALL ( 'Table'[TasterName] ) ) ) ) )Match Lot = VAR PrimaryTaster = SELECTEDVALUE ( Tasters[Primary Taster] ) VAR Taster = SELECTEDVALUE ( 'Table'[TasterName], PrimaryTaster ) RETURN IF ( Taster <> PrimaryTaster, SUMX ( SUMMARIZE ( 'Table', 'Table'[UniqueID], 'Table'[TastingScore] ), INT ( PrimaryTaster IN CALCULATETABLE ( VALUES ( 'Table'[TasterName] ), ALL ( 'Table'[TasterName] ) ) ) ) )% Match = DIVIDE ( [Match Lot], [Number of Lot Tasted] )
tamerj1
3 years agoCommunity Champion
Hi Dhrutivyasa-070
Please refer to attached sample file with the proposed solution.
Number of Lot Tasted =
VAR PrimaryTaster = SELECTEDVALUE ( Tasters[Primary Taster] )
VAR Taster = SELECTEDVALUE ( 'Table'[TasterName], PrimaryTaster )
RETURN
IF (
Taster <> PrimaryTaster,
SUMX (
VALUES ( 'Table'[UniqueID] ),
INT (
PrimaryTaster
IN CALCULATETABLE (
VALUES ( 'Table'[TasterName] ),
ALL ( 'Table'[TasterName] )
)
)
)
)Match Lot =
VAR PrimaryTaster = SELECTEDVALUE ( Tasters[Primary Taster] )
VAR Taster = SELECTEDVALUE ( 'Table'[TasterName], PrimaryTaster )
RETURN
IF (
Taster <> PrimaryTaster,
SUMX (
SUMMARIZE ( 'Table', 'Table'[UniqueID], 'Table'[TastingScore] ),
INT (
PrimaryTaster
IN CALCULATETABLE (
VALUES ( 'Table'[TasterName] ),
ALL ( 'Table'[TasterName] )
)
)
)
)% Match = DIVIDE ( [Match Lot], [Number of Lot Tasted] )Dhrutivyasa-070
3 years agoHelper I
Thank You Very Much @tamrej1
Its working Properly in my Dataset.