Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Tableau to PowerBI ATTR

Help me in converting this Calculation to PowerBI

Note ; Fiscper and Current Fiscpervalue both are numeric values

1=IF ATTR(([Fiscper])=STR([Current Fiscpervalue])) THEN

[6 Inv Start] ELSE LOOKUP( RUNNING_SUM([6 Inv Start])+ RUNNING_SUM(SUM([8 Week Chang R])),-1) END

===============================================================

2= IF ATTR(([Fiscper])=STR([Current Fiscpervalue]))
THEN
LOOKUP(SUM([Act Inv]),-1)
END

==============================

Thanks in Advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please try below dax formula:

1 =
IF (
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( 'Table', 'Table'[Fiscper] = [Current Fiscpervalue] )
    ) = 1,
    [6 Inv Start],
    LOOKUPVALUE (
        [6 Inv Start],
        'Table'[Fiscper], EARLIER ( 'Table'[Fiscper] ),
        'Table'[Week], EARLIER ( 'Table'[Week] )
    )
)
2 =
IF (
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( 'Table', 'Table'[Fiscper] = [Current Fiscpervalue] )
    ) = 1,
    LOOKUPVALUE (
        [Act Inv],
        'Table'[Fiscper], EARLIER ( 'Table'[Fiscper] ),
        'Table'[Week], EARLIER ( 'Table'[Week] )
    )
)

Please note that the formula is based on the assumption that the table name is 'Table'. You may need to replace it with the actual name of your table.
Also, please note that the formula is based on the assumption that the column names are the same as in the Tableau formula. You may need to replace them with the actual column names in your Power BI model.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

Please try below dax formula:

1 =
IF (
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( 'Table', 'Table'[Fiscper] = [Current Fiscpervalue] )
    ) = 1,
    [6 Inv Start],
    LOOKUPVALUE (
        [6 Inv Start],
        'Table'[Fiscper], EARLIER ( 'Table'[Fiscper] ),
        'Table'[Week], EARLIER ( 'Table'[Week] )
    )
)
2 =
IF (
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( 'Table', 'Table'[Fiscper] = [Current Fiscpervalue] )
    ) = 1,
    LOOKUPVALUE (
        [Act Inv],
        'Table'[Fiscper], EARLIER ( 'Table'[Fiscper] ),
        'Table'[Week], EARLIER ( 'Table'[Week] )
    )
)

Please note that the formula is based on the assumption that the table name is 'Table'. You may need to replace it with the actual name of your table.
Also, please note that the formula is based on the assumption that the column names are the same as in the Tableau formula. You may need to replace them with the actual column names in your Power BI model.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Anonymous
Not applicable

Hi, Below is the error

 

Raks_0-1698232419864.png

Please help me on this.

 

Thanks in advance !

lbendlin
Super User
Super User

Forget about Tableau.  Formulate your business requirement and implement it in Power BI.

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.