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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Help Needed :: Group defined Ranges by User Count

I am rather new to Power BI as I am transisitioning from Tableau and I am in need of assistance. I am needing assistance to guide me on how I might go about creating an appropriate 'calculation' in Power BI that will accomplish what I was previously using in Tableau to acheive 'Receipt Quantity by User Count'; my apologies in advance for any miscommunication and/or confusion I may cause when adddressing my request. 

-Goal: Create a bar chart which represents pre-defined 'Receipt' counts (Y Axis) by 'Distinct Count of all Participants' (UserId's)
- I have created a measure which defines my ranges for the above mentioned 'Receipts' however I am unable to now tie that to the 'DistinctCount(UserID).
- The calculation I had used in Tableau allowed for the following (Tableau Calculation listed below):
       {FIXED [Participant Key_C]:
IF COUNTD([Content Key])<= 0 THEN '0'
ELSEIF COUNTD([Content Key])> 0 AND COUNTD([Content Key]) < 2 THEN '1 Receipt'
ELSEIF COUNTD([Content Key])> 1 AND COUNTD([Content Key]) < 3 THEN '2 Receipts'
ELSEIF COUNTD([Content Key])> 2 AND COUNTD([Content Key]) < 4 THEN '3 Receipts'
ELSEIF COUNTD([Content Key])> 3 AND COUNTD([Content Key]) < 5 THEN '4 Receipts'
ELSEIF COUNTD([Content Key])> 4 AND COUNTD([Content Key]) < 6 THEN '5 Receipts'
ELSEIF COUNTD([Content Key])> 5 AND COUNTD([Content Key]) < 7 THEN '6 Receipts'
ELSEIF COUNTD([Content Key])> 6 AND COUNTD([Content Key]) < 8 THEN '7 Receipts'
ELSEIF COUNTD([Content Key])> 7 AND COUNTD([Content Key]) < 9 THEN '8 Receipts'
ELSEIF COUNTD([Content Key])> 8 AND COUNTD([Content Key]) < 10 THEN '9 Receipts'
ELSEIF COUNTD([Content Key])> 9 AND COUNTD([Content Key]) < 11 THEN '10 Receipts'
ELSEIF COUNTD([Content Key])>= 11 THEN '11+ Receipts'
END
}

I have also attached two (2) images in hopes that the provided visual(s) may better illustrate what I am in need of.

Tableau_Calc.PNGGrouping_Visual.PNG
This is the current state of my data in 'Power BI' with call-outs of what I actually need. The Column name 'Entries by Range' is a Measure I have already created, just unable to now group them together appropriatly.
CurrentView_PowerBI.png

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous,

 

Turn your "Entries by Range" into a column, so you can put it on the axis of the Bar Chart. 

 

For the Value you use "UserId" with a distinct count. This should give you the result you have shown. 

 

Jan  

az38
Community Champion
Community Champion

Hi @Anonymous 

just one question: why do you use statement like "COUNTD([Content Key])> 0 AND COUNTD([Content Key]) < 2",but not simple

COUNTD([Content Key]) = 1

Anyway, maybe grouping function (and entire article) https://docs.microsoft.com/en-us/power-bi/desktop-grouping-and-binning  will be useful for you

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.