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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

I have tableau calculation and i want to convert in Power BI DAX

this is tableau calcalation and i want conver into dax

i need help on this..

 

IF LOOKUP(MIN([DCC]),0) = LOOKUP(MIN([DCC]),-1)
THEN DATEDIFF('day',LOOKUP(MIN([CR Status Changed Date]), -1), LOOKUP(MIN([CR Status Changed Date]), 0))
END

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

It looks like you would like to calculate the interval of CR Status Changed Date for same DCC. If so, you may try this Measure.

vcazhengmsft_1-1636966118466.png

 

DateDiff_ =

VAR val =

    SELECTEDVALUE ( 'Table'[CR Status Changed Date] )

VAR cur_date =

    CALCULATE (

        val,

        FILTER ( ALL ( 'Table' ), 'Table'[DCC] = MAX ( 'Table'[DCC] ) )

    )

VAR search_date =

    CALCULATE (

        MIN ( 'Table'[CR Status Changed Date] ),

        FILTER ( ALL ( 'Table' ), 'Table'[DCC] = MAX ( 'Table'[DCC] ) )

    )

RETURN

    DATEDIFF ( search_date, cur_date, DAY )

 

Then, result should look like this:

vcazhengmsft_2-1636966118468.png

 

Attached the pbix file as reference.

 

Best Regards,

Community Support Team _ Caiyun

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it or I misunderstand your needs, please feel free to let me know. Thanks a lot!

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

It looks like you would like to calculate the interval of CR Status Changed Date for same DCC. If so, you may try this Measure.

vcazhengmsft_1-1636966118466.png

 

DateDiff_ =

VAR val =

    SELECTEDVALUE ( 'Table'[CR Status Changed Date] )

VAR cur_date =

    CALCULATE (

        val,

        FILTER ( ALL ( 'Table' ), 'Table'[DCC] = MAX ( 'Table'[DCC] ) )

    )

VAR search_date =

    CALCULATE (

        MIN ( 'Table'[CR Status Changed Date] ),

        FILTER ( ALL ( 'Table' ), 'Table'[DCC] = MAX ( 'Table'[DCC] ) )

    )

RETURN

    DATEDIFF ( search_date, cur_date, DAY )

 

Then, result should look like this:

vcazhengmsft_2-1636966118468.png

 

Attached the pbix file as reference.

 

Best Regards,

Community Support Team _ Caiyun

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it or I misunderstand your needs, please feel free to let me know. Thanks a lot!

amitchandak
Super User
Super User

@Anonymous , In tableau LOOKUP is a table calculation, which means you can go across visual rows. In Power bi, there is no equivalent. You have to perform calculation using row context

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.