March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Can anyone help in converting this code to DAX?
S =
ABS([x]-LOOKUP([x],-1))/
(
SQRT
(
ABS(((([y] + LOOKUP([y],-1))/(SUM([z])+LOOKUP(SUM([z]), - 1)])))
*
(1-(([y] + LOOKUP([y],-1))/(SUM([z])+ LOOKUP(SUM([z]),-1)))))/ (1-((1/(SUM([z])+LOOKUP(SUM([z]),-1))))))
*
(1/SUM([z]) + 1/LOOKUP(SUM[z]),-1))
)
)
Hi, @pk1593
Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Here S (col. highlighted in yellow) is the desired result which ia the significance t-testing forumula.
The table has 3 data points from 2019 to 2021.
x is in percentage, whereas y and z are weigted and unweighted counts of respective years.
@v-zhangti - Just wanted to check if you were able to convert the Tableau code to DAX ?
Hi,
For converting Tableau to DAX try utilizing ChatGPT. It works fast and provides answers like this:
S = ABS([x] - LOOKUPVALUE([x], -1)) / (SQRT(ABS( (([y] + LOOKUPVALUE([y], -1)) / (SUM([z]) + LOOKUPVALUE(SUM([z]), -1))) * (1 - (([y] + LOOKUPVALUE([y], -1)) / (SUM([z]) + LOOKUPVALUE(SUM([z]), -1)))) ) / (1 - ((1 / (SUM([z]) + LOOKUPVALUE(SUM([z]), -1)))))) * (1 / SUM([z]) + 1 / LOOKUPVALUE(SUM([z]), -1)))
You can also replace / with DIVIDE to avoid issues with 0. For the [x], [y] and [z] use the corresponding column refrerences.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
No this is incorrect.
I tried chatGPT but lookupvalue syntax is wrong and not a substitute for Lookup in Tableau.
I see, sorry about that. I just read the LOOKUP documentation in Tableau. The dax equivalent for LOOKUP would be OFFSET
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |