Forum Discussion

Rakesh_508's avatar
Rakesh_508
Helper I
2 years ago

undefined

I have a table with two columns i.e., period which has Day, Month, Week,Quarter, Year and other column is frequency which is number.

 

If the period column has D and frequency 1, then as the output 365 records should come like 
D   1    1
D    1    2

.

.

D     1     365

D      7     1

.

D      7      52

 

we will be having 365 days in a year, 52 weeks in a year,12 months in a year,4 quarters in a year.

 

In the picture , I had selected pro_period is D i.e., D is referred as Date, W is weekly , M is month.. 

respectively in the table visual , first row D has 1 value, 2nd row D ha 7 value like so on...

D has 1 value that means we need to generate 365 rows because of 365 days will be there in a year.

like wise if D has 7 value that means we need to generate 52 rows because 52 weeks will be there in a year.

If has D has 8 value that means we need to generate 45 rows. if  D has 21 then 17 rows has to be generated...

 

The same procedure follows for M , W, Y also...

 

Hope you got the requirement. 

 

Solution for the requirement will be appreciated.


Need help on this..

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Rakesh_508 

    Based on your description, I've created the sample data:

    First of all, I created an index column to sort by the same period and the same frequency:

    I use the following DAX expression to get the column of the expected result:

    rank =
    RANKX (
        FILTER (
            ALLSELECTED ( 'Table (2)' ),
            'Table (2)'[PPO_FREQ] = EARLIER ( 'Table (2)'[PPO_FREQ] )
        ),
        'Table (2)'[Index],
        ,
        ASC
    )

     Here are the results:

    I've provided the PBIX file used this time below.

     

     

     

     

    How to Get Your Question Answered Quickly

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Rakesh_508's avatar
      Rakesh_508
      Helper I

      Hello Anonymous 

       

      Thanks for the reply..

       

      This is not the solution which I am expecting.

       

      we will be having 365 days in a year, 52 weeks in a year,12 months in a year,4 quarters in a year.

       

      In the picture , I had selected pro_period is D i.e., D is referred as Date, W is weekly , M is month.. 

      respectively in the table visual , first row D has 1 value, 2nd row D ha 7 value like so on...

      D has 1 value that means we need to generate 365 rows because of 365 days will be there in a year.

      like wise if D has 7 value that means we need to generate 52 rows because 52 weeks will be there in a year.

      If has D has 8 value that means we need to generate 45 rows. if  D has 21 then 17 rows has to be generated...

       

      The same procedure follows for M , W, Y also...

       

      Hope you got the requirement. 

       

      Solution for the requirement will be appreciated.

       

      Thanks.