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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rwhaley
Regular Visitor

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
JustJan
Responsive Resident
Responsive Resident

Hi @rwhaley,

 

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 @rwhaley 

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors