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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Brenden
Advocate II
Advocate II

"Bucketing" OR how to use this measure in a table

I wrote this measure which achieves what I want - to "bucket" Ticket volumes by how many times they are moved between teams - "0, 1 to 3, >=4, or >= 10" times moved.

 

Move Bucket = IF([Moved Between IT Teams]=0,"0 (Not moved yet)", IF([Moved Between IT Teams]<=3,"1 to 3", IF([Moved Between IT Teams]<10,">=4",IF([Moved Between IT Teams]<40,">=10",IF([Moved Between IT Teams]>=40,">=40")))))
 
Unfortunately after writing this I realized I can't use it as Rows in a Matrix Visual.
 
This is my desired result:
Brenden_0-1694540759929.png

 

My "Move Bucket" measure uses another measure "Moved between IT Teams" which counts the instances where the TICKET ID appears in a column called NEWMATCH. If the "old" team and "new" team in this table contain an eligible IT team, then NEWMATCH is populated with the TICKETID to indicate so, otherwise is blank.

Moved Between IT Teams = COUNTROWS(FILTER('2 Audit',CONTAINS('4 Report',[TICKET_ID],'2 Audit'[NEWMATCH])))
1 ACCEPTED SOLUTION

It is (quite) possible I misunderstood. However I did find a solution.

After relating my tables correctly, I added two columns to the main fact table. First to count how many rows matched the TICKETID from the other log table, and second to bucket that count depending on the value within.

1: Moved Between IT Teams_ = COUNTROWS(RELATEDTABLE('2 Audit'))


2: Move Bucket_ = IF('4 Report'[Moved Between IT Teams_] =0, "0 (Not moved yet)", IF('4 Report'[Moved Between IT Teams_] <=3, "1 to 3", IF('4 Report'[Moved Between IT Teams_] <10,">=4",IF('4 Report'[Moved Between IT Teams_]<40,">=10",IF('4 Report'[Moved Between IT Teams_]>=40,">=40")))))



 

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@Brenden I think it is exactly the same thing as what is in the video.  You are dynamically calculating the measure in which range a ticket is and then trying to use it on a row or slice by this. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

It is (quite) possible I misunderstood. However I did find a solution.

After relating my tables correctly, I added two columns to the main fact table. First to count how many rows matched the TICKETID from the other log table, and second to bucket that count depending on the value within.

1: Moved Between IT Teams_ = COUNTROWS(RELATEDTABLE('2 Audit'))


2: Move Bucket_ = IF('4 Report'[Moved Between IT Teams_] =0, "0 (Not moved yet)", IF('4 Report'[Moved Between IT Teams_] <=3, "1 to 3", IF('4 Report'[Moved Between IT Teams_] <10,">=4",IF('4 Report'[Moved Between IT Teams_]<40,">=10",IF('4 Report'[Moved Between IT Teams_]>=40,">=40")))))



 

parry2k
Super User
Super User

 I did a video on how to address measures as columns, check it out here: 

@Brenden

 

https://youtu.be/-T1hK5W4m8I



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks for the quick reply.

I watched the video, but I think I my problem lies somewhere in between the steps in the video.

I need to find a way to add a column in my table that will do the same calculation that my measure is doing (since I cannot use the measure to give me each bucket option).

Brenden_0-1694545384610.png

 

 

I don't believe my scenario matters which of my tables has the column. I just need the column to check my fact table and group by summed volumes.

Eg. If TICKETID "T123" appears 3 times, the column says "1 to 3". If TICKETID "456" appears 11 times, ">=10".

My buckets to be defined are as follows:
a. "0 (not moved yet)"

b. "1 to 3"

c. ">=4"
d. ">=10"

e. ">=40"


 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.