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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sreddy47652
Helper III
Helper III

Convert Tableau expression into power bi DAX

Hi Team, Need some help to convert tableau expression to power bi "ATTR([TSR Created Date _ Today N])", i tried with selectedvalue function but it's not working so can anyone help me how to convert from Tableau to Power bi.

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@sreddy47652 These usually go better if you provide sample data and expected result but in this case, I believe the equivalent DAX is:

 

Measure = 
  VAR __Table = SUMMARIZE( 'Table', [TSR Created Date _ Today N] )
  VAR __Result = IF( COUNTROWS( __Table ) > 1, "*", MAXX( __Table, [TSR Created Date _ Today N] ) )
RETURN
  __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @sreddy47652 ,

See the below data:

vyilongmsft_0-1724221325433.png

When I use attr:

vyilongmsft_1-1724221216437.png

Final I get:

vyilongmsft_2-1724221216615.png

 

Import data to Power BI:

vyilongmsft_1-1724221885581.png

You can try this DAX code: 

ATTR = 
VAR MAXVALUE =
    CALCULATE (
        MAX ( 'Table'[State] ),
        FILTER ( ALL ( 'Table' ), 'Table'[City] = MAX ( 'Table'[City] ) )
    )
VAR MINVALUE =
    CALCULATE (
        MIN ( 'Table'[State] ),
        FILTER ( ALL ( 'Table' ), 'Table'[City] = MAX ( 'Table'[City] ) )
    )
RETURN
    IF ( MAXVALUE = MINVALUE, MAX ( 'Table'[State] ), "*" )

Finally you will get what you want.

vyilongmsft_2-1724222279081.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

@sreddy47652 These usually go better if you provide sample data and expected result but in this case, I believe the equivalent DAX is:

 

Measure = 
  VAR __Table = SUMMARIZE( 'Table', [TSR Created Date _ Today N] )
  VAR __Result = IF( COUNTROWS( __Table ) > 1, "*", MAXX( __Table, [TSR Created Date _ Today N] ) )
RETURN
  __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.