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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
TheBlackPug
Frequent Visitor

Help with migrating a calculation from Tableau to PowerBI

Tableau Calc: 

{FIXED[Prod_ Order No_],[Prod_ Order Line No_]: MIN(IIF([No_]="FINPRINT",[Posting Date],

({FIXED[Prod_ Order No_],[Prod_ Order Line No_]: MIN(IIF(([No_]="SMARTCARD VAULT" OR [No_]="FINCARD VAULT"),[Posting Date],NULL) )})

))}

 

Tried to replicate it in PowerBI but dont know how to get around the IIF function:

Date Finished = IF('Wastage Data'[No_] = "FINPRINT",
CALCULATE(
LASTDATE('Wastage Data'[Posting Date]),
ALLEXCEPT('Wastage Data','Wastage Data'[Prod_ Order No_],'Wastage Data'[Prod_ Order Line No_])),
IF(('Wastage Data'[No_] = "SMARTCARD VAULT" || 'Wastage Data'[No_] = "FINCARD VAULT"),
CALCULATE(
LASTDATE('Wastage Data'[Posting Date]),
ALLEXCEPT('Wastage Data','Wastage Data'[Prod_ Order No_],'Wastage Data'[Prod_ Order Line No_])),
0))
 
Any help is appreciated
4 REPLIES 4
goncalogeraldes
Super User
Super User

Hello there! Its kinda hard to understand the use of this measure but you can check if this does what you want:

 

 

Date Finished =
VAR _lastdate =
    CALCULATE (
        LASTDATE ( 'Wastage Data'[Posting Date] ),
        ALLEXCEPT (
            'Wastage Data',
            'Wastage Data'[Prod_ Order No_],
            'Wastage Data'[Prod_ Order Line No_]
        )
    )
RETURN
    IF (
        SELECTEDVALUE ( 'Wastage Data'[No_] ) in { "FINPRINT", "SMARTCARD VAULT", "FINCARD VAULT"},
        _lastdate,
        0
)

 

goncalogeraldes_1-1643391926022.png

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

 

Thank You all for your attempts. I just made the calculation more complicated then I had to. 

 

The answer is below for anyone who runs into a similar problem:

 

Answer.PNG

 

Anonymous
Not applicable

Hi @TheBlackPug,

Perhaps you can try using the following measure formula if helps:

Measure =
CALCULATE (
    MAX ( 'Wastage Data'[Posting Date] ),
    FILTER (
        ALLSELECTED ( 'Wastage Data' ),
        'Wastage Data'[No_] IN { "FINPRINT", "SMARTCARD VAULT", "FINCARD VAULT" }
    ),
    VALUES ( 'Wastage Data'[Prod_ Order No_] ),
    VALUES ( 'Wastage Data'[Prod_ Order Line No_] )
)

If these also don't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

AlexisOlson
Super User
Super User

Many of us here are not fluent in Tableau. Can you explain what the calculation is intended to do and share some sample input and desired output as an example to test against?

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors