Forum Discussion

NandiniAna's avatar
NandiniAna
New Member
5 years ago

Data vanishes after a split second!Urgent help

Hi,

 

The data seems to appears for a Split second and then shows zero.Please could someone help me on this. And the formula below was working so far and only difference now is that we updated the november upgrade recently apart from that no changes were made.

 

AvgFIRM_SellingPrice =
var firm_userprincipalname = [MF_USERPRINCIPALNAME]
RETURN
CALCULATE ( AVERAGE(IMPORT_SQL_monthly[SellingPrice] ),OR(IMPORT_SQL_monthly[CurrentStatus]="Sold", IMPORT_SQL_monthly[CurrentStatus]="SaleComplete"), TBL_CALENDAR_periods[Value] = "This year", LOOKUP_MF_USERS[PrincipalName] = firm_userprincipalname , IMPORT_SQL_monthly[PartShare] = 0, USERELATIONSHIP( IMPORT_SQL_monthly[DateSold], TBL_CALENDAR_date[Date] ), USERELATIONSHIP( IMPORT_SQL_monthly[MemberFirm], LOOKUP_MF_USERS[firm]) ) + 0

 

Thanks.

1 Reply

  • I suggest you work through it bit by bit. Forums are not really suitable for "urgent" help.

    1) Move all the code that you have under RETURN, to be placed above the RETURN and put it into it's own variable.

    2) Then under the RETURN  put firm_userprincipalname to make sure it has a valid value (test it in a table visual or something). If it doesn't, then it'll find no rows in the rst of the code and you'll just get a zero result.

    3) Maybe even comment out one line ata time in the filters of the CALCULATE(), until you start getting some values. This will help narrow down which filter is hiding all your rows.

     

    Code formatted

     

    AvgFIRM_SellingPrice =
    VAR firm_userprincipalname = [MF_USERPRINCIPALNAME]
    RETURN
        CALCULATE (
            AVERAGE ( IMPORT_SQL_monthly[SellingPrice] ),
            OR (
                IMPORT_SQL_monthly[CurrentStatus] = "Sold",
                IMPORT_SQL_monthly[CurrentStatus] = "SaleComplete"
            ),
            TBL_CALENDAR_periods[Value] = "This year",
            LOOKUP_MF_USERS[PrincipalName] = firm_userprincipalname,
            IMPORT_SQL_monthly[PartShare] = 0,
            USERELATIONSHIP ( IMPORT_SQL_monthly[DateSold], TBL_CALENDAR_date[Date] ),
            USERELATIONSHIP ( IMPORT_SQL_monthly[MemberFirm], LOOKUP_MF_USERS[firm] )
        ) + 0