Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
12 | |
9 | |
9 | |
9 |
User | Count |
---|---|
21 | |
14 | |
14 | |
13 | |
13 |