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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vissvess
Helper V
Helper V

GCD 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 case it will have 1 to many values in it.

 

Kindly please anyone suggest any workaround for GCD (Greatest Common Divisor).

 

The data set is as follows.

Material RequestTimeIDRequestConfirmed
432876:09:32 PMALKDE418
787446:37:49 PMSDKED320
4644710:33:38 AMALKDE536
8711811:39:09 AMADKED410
256602:38:27 AMCNEDD212
365985:42:56 AMALKDE727
760689:40:03 AMSDKED1015
893348:51:45 PMADKED450

 

IDDescPen Size
SDKEDStorage5
ADKEDBottle10
CNEDDBag12
ALKDECouch9

 

In this Table 1 is the data table. table 2 to be added with a custom calculated column, where the two tables are related with ID column in both tables. The underlined column is the new column to be added based on table 1.

 

The result is as follows. For ALKDE = 9 (GCD of 18, 27 & 36).

 

Any kind help would be much appreciated.

 

Thanks

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Here you are:

 

 

View solution in original post

@vissvess 

 

Sample file attached as well

 

GCD.png


Regards
Zubair

Please try my custom visuals

View solution in original post

14 REPLIES 14

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors