Forum Discussion
PeterBI
Helper I
9 years agoCreating and Using Measures in this Example
Hello, I just started with PowerBI and need a little Help in creating measures and using it in a view. I have the following Table with a relation to the datekey Table and the Idea for the view. ...
- 9 years ago
Hi PeterBI,
First of all I just complicated the measure a lot just use this and it works perfectly good:
WinnerQuote = DIVIDE ( CALCULATE ( COUNT ( Winner[Winner] ), Winner[Winner] = 1 ), CALCULATE ( COUNT ( Winner[Winner] ) ) )Just being hard because of a different problem I had before.
Regarding the setup of the table here is the full menu copy:
Regards,
MFelix
MFelix
Super User
9 years agoHi PeterBI,
First of all don't know if your example in the Excel is based on the values you have in your PBIX file but add this measure:
WinnerQuote =
VAR WeekValue =
MIN ( DateKey[Week] )
RETURN
IF (
MAX ( DateKey[Week] ) = WeekValue,
DIVIDE (
CALCULATE ( COUNT ( Winner[Winner] ), Winner[Winner] = 1 ),
CALCULATE ( COUNT ( Winner[Winner] ), DateKey[Week] = WeekValue )
),
DIVIDE (
CALCULATE ( COUNT ( Winner[Winner] ), Winner[Winner] = 1 ),
CALCULATE ( COUNT ( Winner[Winner] ), DateKey[Week] = DateKey[Week] )
)
)
The result is as follow:
regards,
MFelix