Forum Discussion
vissvess
Helper V
7 years agoGCD for multiple values
Hi all, I recently came accross a requirement to get a calculated column that gets a GCD of multiple values in the related table. Unfortunately, DAX syntax for GCD is for only two values. My ...
- Anonymous7 years ago
Here you are:
- 7 years ago
vissvess
Helper V
7 years agoHi Anonymous ,
This is not that only 3 entries.
There may be n entries.
So could you suggest me a workaround in detail for me to get the GCD of n numbers in column.
Also, if DAX doesnot support recursive calculations, could it be done in M (Power Query)?.
Thanks
Anonymous
7 years agoNot applicable
First of all, the formula I've given you works for ANY number of arguments, not just 3. The extension into n arguments happens through The Induction Principle that you should be familiar with from your mathematics class.
Second, I'll check if there is a function in Power Query that would do that for you.
Best
Darek
Second, I'll check if there is a function in Power Query that would do that for you.
Best
Darek
- vissvess7 years ago
Helper V
Hi Anonymous ,
It is obvious that the math would work.
I need to clarify my requirement, that there are unknown number of variables to be included.
As far as my search, I have not came accross a M script for GCD directly.
Yet, there would a workaroud. Please share if you formulate one.
Thanks.
- Anonymous7 years agoNot applicable
Here you are:
- AlePeraltaM3 years agoFrequent Visitor
Is there any chance of do it in a measure with multiple inputs?
- Anonymous7 years agoNot applicableI know how to do it in PQ. Just need to set it all up. Bear with me.
Best
Darek