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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

"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
Anonymous
Not applicable

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

@Anonymous 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.

Anonymous
Not applicable

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: 

@Anonymous

 

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.

Anonymous
Not applicable

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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