Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Aadwark
New Member

power bi countrows between range

Hi guys,

 

Im looking for a solution to count how many snapshots do we have which are between 0-5, 5-15 and over 15 days old.

 

I could do it easily in xls like : =COUNTIFS(Actual!I:I,"EMEA",Actual!C:C,">=5",Actual!C:C,"<=15")

 

But i have spent million hours already to figure out how should i do in Power but i still have no idea, i have tried this: CALCULATE(COUNT(Actual[Snapshot Age (Days)]),'Actual'[Snapshot Age (Days)] <5 it was working if i have only 1 variables,

 

but if i wants to have it between the range its not working : 

CALCULATE(COUNT(Actual[Snapshot Age (Days)]),'Actual'[Snapshot Age (Days)] <5,Actual[Snapshot Age (Days)] >15)

 

If you can give me some advice it will be much presiated.

 

Thanks

1 ACCEPTED SOLUTION

@Aadwark , you can simply create a new column

If [Snapshot Age] is a column and then you can use count of any column

Switch(true(),

[Snapshot Age] < 5, "   Days < 5" ,

[Snapshot Age] < 15, "  Days 5 - 15" ,

 " >15" )

 

If [Snapshot Age] is measure follow the link I have given in last update

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Aadwark , Not very clear. Bust seems like you need a bucketing on measure

 

Have a measure

COUNT(Actual[Snapshot Age (Days)])

 

 

and follow this concept

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I will check thanks,

 

but i also try to make it more clear 🙂

 

So i have a table with the data like this:

 

VM nameSnapshot Age
VM113
VM2144
VM324
VM424
VM5221
VM6285
VM7290
VM8156

 

And in xls i could count the number of VMs which has snapshots, and those snaps are between range (old).

Like we have 13 VM where their snapshot are between 0-5 days old

than 7 VM where their snapshot are between 5-15 days old

than 56 VM where their snapshot are between 5-15 days old

 

EMEA
DaysNumber
513
5-157
1556

 

I also could make it done in Power when i have used a single xls file, but all of my calculation was inside the xls so the power only visualized, but because i have multiple location i would automate it and grab all xls from a folder, therefore i cannot have any calculation inside of the xls files so it has to be done in Power.

 

image.png

 

i hope its more clear now 😛

Thanks

@Aadwark , you can simply create a new column

If [Snapshot Age] is a column and then you can use count of any column

Switch(true(),

[Snapshot Age] < 5, "   Days < 5" ,

[Snapshot Age] < 15, "  Days 5 - 15" ,

 " >15" )

 

If [Snapshot Age] is measure follow the link I have given in last update

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Awesome, it was working

 

Thank you so much

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors