Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
10 | |
6 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |