Forum Discussion

sutanukadas's avatar
sutanukadas
New Member
9 months ago
Solved

Generate series function using with measure is giving value until 5739 and not beyond

Hi Team,

I am using the following functions
1. Max_Prem = AVERAGE('table'[base_net_premium])*(1+(AVERAGE('table'[upper_bound_rating_factor])/100))
2.T
heoretical_best_factor = (1/-AVERAGE('table'[slope]))/SELECTEDVALUE('table'[base_net_premium])
3.
Theoretical Premium = IF ([Theoretical Best Factor Validated]<>0AVERAGE('table'[base_net_premium]) * [Theoretical Best Factor Validated],[Max_Prem])
4. 
Premiums Table = GENERATESERIES(0,[Theoretical Premium],[Theoretical Premium]/100)

Problem is in this generate series function the last value picked up is 5739 for Theoritical Premium, though the value for Theoritical Premium is greater than 11000. 
Can you please help me with a solution to my problem.

4 Replies

  • sutanukadas , Premiums Table is based on measure. The table is static in nature, which means it will get loaded at the time of data refresh, and the measure is dynamic calculated at run time. But in this case it will act like static value without any context 

    Try for dynamic segmentation 
    Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

    Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

     

    Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://youtu.be/EyL7KMw877Q

    Power BI ABC Analysis using Window function, Dynamic Segmentation: https://youtu.be/A8mQND2xSR4

  • Hi sutanukadas,

     

    If the theoretical premium can be calculated using columns available in the data source, the following Power Query logic can be used to generate a series:

     

    let
        Source = ...,
        MaxPrem = List.Max(Source[base_net_premium]) * (1 + List.Max(Source[upper_bound_rating_factor]) / 100),
        Step = MaxPrem / 100,
        Series = List.Generate(
            () => 0,
            each _ <= MaxPrem,
            each _ + Step
        ),
        SeriesTable = Table.FromList(Series, Splitter.SplitByNothing(), {"Premium"})
    in
        SeriesTable

     

    This script calculates the maximum premium based on column values and generates a list of values from 0 to that maximum, incremented by a defined step.

     

    Limitations:

    Power Query cannot evaluate DAX measures or respond to user interactions such as slicers.
    If the maximum value depends on dynamic context or user selections, Power Query is not suitable. In such cases, DAX with GENERATESERIES is the appropriate solution.

     

    • v-menakakota's avatar
      v-menakakota
      Icon for Community Support rankCommunity Support

      Hi sutanukadas ,
      Thanks for reaching out to the Microsoft fabric community forum. 

       

      I would also take a moment to thank amitchandak   , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

      I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

       

       

      Best Regards, 
      Community Support Team  

      • v-menakakota's avatar
        v-menakakota
        Icon for Community Support rankCommunity Support

        Hi sutanukadas ,

        I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

         

         

        Best Regards, 
        Community Support Team