Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I am trying to find out total number of occurences of a Range measure .
I have a column called offset from the time table & for every offset, based on certain conditions am finding the range .Requirement is to count the number of occurenecs for each range as shown below in the expected output column.
I am using offset column and range measure in a table visual and am looking to solve this without creating any calculated table as connection method is Live.
Solved! Go to Solution.
Hi, @as1195
You can try the following methods.
Measure:
Range = SWITCH(TRUE(),
SELECTEDVALUE('Table'[Number])>=151&&SELECTEDVALUE('Table'[Number])<157,"151-157",
SELECTEDVALUE('Table'[Number])>=139&&SELECTEDVALUE('Table'[Number])<145,"139-145",
SELECTEDVALUE('Table'[Number])>=133&&SELECTEDVALUE('Table'[Number])<139,"133-139",
SELECTEDVALUE('Table'[Number])>=127&&SELECTEDVALUE('Table'[Number])<133,"127-133")Count =
VAR CurrentRange = [Range]
RETURN
CALCULATE(COUNTROWS('Table'), FILTER(ALL('Table'), [Range] = CurrentRange ))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @as1195
You can try the following methods.
Measure:
Range = SWITCH(TRUE(),
SELECTEDVALUE('Table'[Number])>=151&&SELECTEDVALUE('Table'[Number])<157,"151-157",
SELECTEDVALUE('Table'[Number])>=139&&SELECTEDVALUE('Table'[Number])<145,"139-145",
SELECTEDVALUE('Table'[Number])>=133&&SELECTEDVALUE('Table'[Number])<139,"133-139",
SELECTEDVALUE('Table'[Number])>=127&&SELECTEDVALUE('Table'[Number])<133,"127-133")Count =
VAR CurrentRange = [Range]
RETURN
CALCULATE(COUNTROWS('Table'), FILTER(ALL('Table'), [Range] = CurrentRange ))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please try
Occursnces = CALCULATE(COUNT('Table'[column]),allexcept('Table','Table'[Range]))
Hi,
Thanks for the reply!
But I dont think this will work as Allexcept only takes table and column as arguments wherin in my case "Range" is calculated measure and not a column
ok can you please provide a sample dataset taht isnt confidential as well as your measures
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |