Skip to main content

How can we generate a series of odd numbers or even numbers?

Table of Contents

In Power BI, you can use the DAX GENERATESERIES function to create a series of odd or even numbers.

To generate a series of odd numbers, you can use this DAX expression:

Using this expression, you can generate odd numbers from 1 to 10 with an increment of 2. You can adjust the start and end values based on your requirements.

To generate a series of even numbers, you can use the following DAX expression:

This expression generates odd numbers from 1 to 10 with an increment of 2. You can adjust the start and end values based on your specific needs.

To generate a series of even numbers, you can use the following DAX expression:

An expression like this generates a series of even numbers from 2 to 10, with an increment of 2. You can adjust the start and end values as needed.

These expressions will generate in Power BI calculated tables containing the desired series of numbers, odd or even.

In Power Query, the function List.Numbers can be used to create numbers.

Do this in Power Query by creating a new query and using the following formula:

This formula will produce a list of odd numbers from 1 through 9 by 2’s.

To convert list to table: Use Table.FromList.

In Power Query M Language to an existing Table add Index columns: use Table.AddIndexColumn. Add new step in Advanced Editor.

For the generation of odd numbers:

Add comment