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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Capture range of cases based on column count

I currently have two columns of data:

Identifier Count Latest Week & Number of cases associate with each identifier:

 

I'm trying to create a measure to capture the range of cases according to each location e.g. below 1-3 OR 2-21

LocationIdentifier Count Latest WeekNumber of CasesRange
Comm. Hosp.111-3
Comm. Hosp.131-3
Hospital2102-21
Hospital1132-21
Hospital422-21
Hospital3212-21
Hospital272-21

 

I've tried :

Range = FORMAT(CALCULATE(MIN('Sheet1'[Column Count Latest Week])) ,"#") & 
" - " & FORMAT( CALCULATE(MAX('Sheet1'[Column Count Latest Week])), "#") 
 
but no luck
 
can anyone help?

 

Sample

https://www.dropbox.com/s/3eba6f6fsz7hfem/Range%20Sample.pbix?dl=0

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Do you want a calculated column formula solution or a measure solution?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

I think a measure would work best

Hi,

See if the Dynamic segmentation technique helps - Dynamic segmentation – DAX Patterns


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Microsoft Employee
Microsoft Employee

I looked at your pbix file.  Before a solution for Range can be suggested, here are a couple suggestions/questions.

 

1. For your Area Grouping column, the use of a Groups column would be easier and easier to update later (vs. the use of SWITCH(TRUE() you've used; it works but just showing an easier way).  Please see this link.

Use grouping and binning in Power BI Desktop - Power BI | Microsoft Docs

 

2.  I believe everything you want to do can be accomplished with measures instead of columns.  If you plan to use the column in a visual legend, axis, etc., a column is needed though.

 

3.  Your Total Count Latest Week measure is overly complex.  Please explain the calculation you need and a simpler solution can be suggested.

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Agreed the grouping solution could be better edited via Power BI groupings rather than DAX.

 

Measures seem to be the best way to go with matrix tables.

 

All I'm trying to do is get the number of [Identifier Count] & [No. of Cases] & [Range Min-Max] for the most current week number e.g. 47

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.