Divide values into randomly unequal parts using DAX

How do I divide values into randomly unequal parts using DAX?

See the attached file for the Excel version.

EDNA_Random_Divide.xlsx (11.9 KB)

Split Yearly into monthly.pbix (113.7 KB)

Thanks!

DAX does have the RAND function and the RANDBETWEEN function, one of these should do the trick.

RAND - https://info.enterprisedna.co/dax-function-guide/rand/
RANDBETWEEN - https://info.enterprisedna.co/dax-function-guide/randbetween/

1 Like

Hi @Heather,

I am aware of the functions thanks, but how would I structure the Excel solution into a DAX formula?

Thanks!

please provide a mockup DAX file, so that I or another forum member (if I don’t get back to it right away) can be built to suite your situation.

I will put one together soon, thanks.

@Heather, here’s the sample file: Split Yearly into monthly.pbix (113.7 KB)

@powerbideveloper,

See if this does the trick:

Key change:

Total Random Factor by Yr = 

CALCULATE(
    SUMX(
        'Random List',
        [Random Factor]
    ),
    REMOVEFILTERS( 'Date' ),
    REMOVEFILTERS( 'Yealy Sales' ),
    REMOVEFILTERS( 'Random List'),
    VALUES( 'Yealy Sales'[Year] )
)

Full solution file attached.

3 Likes

Thanks, @BrianJ, this is great!

1 Like