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
JohnThomas
Helper II
Helper II

Any way to use DAX to Generate a Custom Series

Hi everyone...

 

I am trying to generate a series of numbers using DAX but I need to have better control over the values.  The desired outcome would be the following columns:

  • Period: Starts at 1. Finish at 104 (Period Start/Finish is a sequence of numbers, 1, 2, 3, ... 104  but the overall goal would be to generate a series of dates.  Weekly in this example or 2 years of weeks. 
  • Value: A decimal number with the following constraints:
    • Min Value: 500
    • Max Value: 10,500
    • Peak Period: 58 
    • Total Value: 540,800
  • Goal is to get a total of 540,800 (Work Hours) spread between the start period and end period with the defined bell curve.
  • The values should fit in a bell shaped curve with peak at period 58.  If the peak period is changed to 75, then the bell curve would be skewed to peak at period 75.

The resulting table would be:

 

Period Value

1          500

2          1000

3          1500

4          2500

...

57          9500

58          10500

59          9500

...

102         1500

103         1000

104         500

 

I have been working with GENERATESERIES but it doesn't allow any other parmaters beyond start/finish.  Likewise, RANDBETWEEN doesn't allow any parmaters to influence the numbers generated.  

 

Any bright ideas would be appreciated...

 

Thanks,

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@JohnThomas Wouldn't you want to use ADDCOLUMNS around a GENERATESERIES and use NORM.DIST?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@JohnThomas Wouldn't you want to use ADDCOLUMNS around a GENERATESERIES and use NORM.DIST?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler thanks for the suggestion.  I'll take a look at that and let you know what I find out.  I'll try to narrow down the problem to something that's a bit more specific with some sample data.

 

Thanks!

@JohnThomas  or something like:

Table 2 = 
    ADDCOLUMNS(
        GENERATESERIES(1,104,1),
        "Value1",10500 - ABS(58 - [Value]) * 184
    )

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.