Forum Discussion
gmasta1129
4 years agoResolver I
IF/OR Statement with Measure & Column
I created a measure which sums the column "profit/loss" by column "master portolio id"... Net FX P&L2 = CALCULATE ( SUM ( 'daily_report'[profit/loss]), FILTER ( ALLSELECTED ( 'daily_report' ),...
- 4 years ago
Hi,
Thank you for your message.
Could you please try something like below?
Net FX P&L2 Sample Data 2 measure: = VAR _masterid = MAX ( SampleData2[Master Portfolio ID] ) VAR _currentdate = MAX ( SampleData2[Run Date] ) RETURN SUMX ( ADDCOLUMNS ( FILTER ( SampleData2, SampleData2[Facility Code] = SampleData2[Master Portfolio ID] ), "@expectedmeasure", CALCULATE ( SUMX ( FILTER ( ALL ( SampleData2 ), SampleData2[Master Portfolio ID] = _masterid && SampleData2[Run Date] = _currentdate ), SampleData2[Profit/Loss] ) ) ), [@expectedmeasure] ) + 0
Jihwan_Kim
4 years agoSuper User
Hi,
Please check the below picture and the attached pbix file.
I tried to create a sample pibx file like below.
It is for creating a measure.
Net FX P&L2 measure: =
VAR _masterid =
MAX ( Data[Master Portfolio ID] )
RETURN
SUMX (
ADDCOLUMNS (
FILTER ( Data, Data[Facility Code] = Data[Master Portfolio ID] ),
"@expectedmeasure",
CALCULATE (
SUMX (
FILTER ( ALL ( Data ), Data[Master Portfolio ID] = _masterid ),
Data[Profit/Loss]
)
)
),
[@expectedmeasure]
) + 0