cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
esam
Frequent Visitor

how to create range with data

Hey all,

I have a data with range from 10-100 suppose and I want segregate that data with 5 increment and count the number in that range 

e.g

0-5 -0

5-10 -0

10-15 -11 like this

But I have data starting from 10 only 0-5 range is not present so when I am creating the table 0-5 range is not present

can anyone please guide me how to achieve this ?

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @esam 

You can refer to the following example

1.Create the calculated table

Table = var a=GENERATESERIES(1,100/5,1)
return ADDCOLUMNS(a,"Range",[Value]*5-5&"-"&[Value]*5)

vxinruzhumsft_0-1686622313969.png

 

2.The example data table

vxinruzhumsft_1-1686622377868.png

 

3.Create the measure

Measure = COUNTROWS(FILTER('Table 2',[Value]>SELECTEDVALUE('Table'[Value])*5-5&&[Value]<=SELECTEDVALUE('Table'[Value])*5))

 

vxinruzhumsft_2-1686622522372.png

 

 

 

Best Regards!

Yolo Zhu

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

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @esam 

You can refer to the following example

1.Create the calculated table

Table = var a=GENERATESERIES(1,100/5,1)
return ADDCOLUMNS(a,"Range",[Value]*5-5&"-"&[Value]*5)

vxinruzhumsft_0-1686622313969.png

 

2.The example data table

vxinruzhumsft_1-1686622377868.png

 

3.Create the measure

Measure = COUNTROWS(FILTER('Table 2',[Value]>SELECTEDVALUE('Table'[Value])*5-5&&[Value]<=SELECTEDVALUE('Table'[Value])*5))

 

vxinruzhumsft_2-1686622522372.png

 

 

 

Best Regards!

Yolo Zhu

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

NaveenGandhi
Super User
Super User

Hello @esam 

Check the attached PBIX. I have recreated the scenario.

 

  • Create the range column.
  • Create the Dim table and establish a relationship.
  • Now use the range from Dim table and count measure to create a table visual. (Dont forget to turn on  "show items with no data" as below.
    NaveenGandhi_0-1686330942478.png

     

Let me know if this helps!

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors