Forum Discussion
Creating and Using Measures in this Example
- 8 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
Hi 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
Hi MFelix,
Thank You Very much. Is it possible to post a screenshot from the Visu Menue where you configure the Table?
Kind Regards
Peter
- MFelix8 years agoSuper User
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
- PeterBI8 years agoHelper I
Hi MFelix,
Thanks again. I'm using this example to learn DAX so please excuse the next question, if it is so simple ;-)
Where do you get the Values? Are there aditionally measures? Can you send me the PBIX File?
Kind Regards
Peter
- MFelix8 years agoSuper User
Hi PeterBI,
The values are all of the columns in your file however I have used the summarized options and also made the change of one of the columns:
Number of trades = Count of Winner - rename it (double click on the Values field)
Winner count = Sum of Winner - rename it (double click on the Values field)
Winner Quote = Measure created
Revenue = Sum of Revenue
Here is the PBIX file updated.
Any questions please feel free to send a message.
Regards,
MFelix