cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rtum
Regular Visitor

Tableau to DAX

Hi All,

 

I have this formula in Tableau

MC1M={FIXED [Oy Om],[SEQ]: IF SUM(IF [M C Survival Month Diff]<1 THEN 1 ELSE 0 END )>=1 THEN 1 ELSE 0 END}

OyOm=yearmonth

SEQ=1 to 60.

I wore the above in DAX as follows:

IF( CALCULATE(If(sum(Table1.[M C Survival Month Diff])<1,1,0),ALLEXCEPT(Table1,Table1[SEQ],Table[OY_OM]))>=1,1,0)
where
MC Survival Diff :
DATEDIFF((Table1[Date]),CALCULATE(MAX(Table1[Date]),ALLEXCEPT(Table1,Table1[SEQ])),MONTH)
Anything wrong with my DAX?
My calculation are not correct.
Regards,
Raj
 
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Rtum ;

You could create a measure as follows:

Measure = IF( CALCULATE( COUNT('Table'[diff]),FILTER(ALL('Table'),[SEQ]=MAX([SEQ])&&[Oy Om]=MAX([Oy Om])&&[diff]=0))>=1,1,0)

Or

Measure 2 = IF(SUM([diff])<1,1,0)

The final output is shown below:

vyalanwumsft_0-1637287599431.png

If I misunderstand your logic, can you share the results you want to output and your logic according to the simple sample ? because I am not particularly familiar with Tabulea.Looking forward to your reply!


Best Regards,
Community Support Team_ Yalan Wu
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

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Rtum ;

You could create a measure as follows:

Measure = IF( CALCULATE( COUNT('Table'[diff]),FILTER(ALL('Table'),[SEQ]=MAX([SEQ])&&[Oy Om]=MAX([Oy Om])&&[diff]=0))>=1,1,0)

Or

Measure 2 = IF(SUM([diff])<1,1,0)

The final output is shown below:

vyalanwumsft_0-1637287599431.png

If I misunderstand your logic, can you share the results you want to output and your logic according to the simple sample ? because I am not particularly familiar with Tabulea.Looking forward to your reply!


Best Regards,
Community Support Team_ Yalan Wu
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

amitchandak
Super User
Super User

@Rtum , MC survival is measure then you do need a sum

 

a new measure like

If(sum(Table1.[M C Survival Month Diff]),ALLEXCEPT(Table1,Table1[SEQ],Table[OY_OM])<1,1,0)

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors