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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Austin_Fisher
New Member

Counting values in a MEASURE

Hi!

I am currently learning Power BI and I have taken a stumble... 

I have a field that I created through a measure - so it is not a part of a table since I calculated it from my original table (just to clarify). However I am trying to take the data one step further and "measure the measure" essentially. 

My original measures name is "RFI's Completed Ontime" and within that measure I have 3 catagories - "On-Time", "Late" & "Unresolved". 

However, now I am trying to quantify/count how many times each of these words occures in that measure so that I can put them in a pie chart. 

Keep in mind, I am essentially attempting to take a MEASURE OF A MEASURE

 Capture.PNG

Above is a screen shot of the measure I am attempted to measure. I know it looks like its in a table, but it is just a measure being displayed in one of the views.

 

 

****TO ADD CONTEXT*******

Here is the DAX I used to created the first measure, if it is not possible to take a measure of a measure, then maybe it would be possible to tweek the first measure to get the desired outcome as explained about? SEE BELOW

 

RFI's Completed Ontime =
VAR NumDays = [RFI's Days Under or Overdue]
VAR Result =
SWITCH(
    TRUE(),
    ISBLANK(NumDays),"Unresolved",
    NumDays <1, "On-Time",
    NumDays >=-1, "Late")
    RETURN Result
3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @Austin_Fisher 

According to your descritpion, you want to count the measure value with three options.

Here are the steps you can refer to :

(1)This is my test data:

vyueyunzhmsft_0-1693798171189.png

(2)We can create a table using "Enter Data":  The table name is 'Table 2'

vyueyunzhmsft_1-1693798195850.png

We do not need to create any relationship between tables.

 

(3)Then we can create a measure :

Count Measure = var _t = SUMMARIZE('Table' ,'Table'[Master] ,'Table'[Customer], "RFI Measure" , [RFI's Completed Ontime])
var _cur_master = MAX('Table'[Master])
var _cur_type= MAX('Table 2'[Column1])
return
 COUNTROWS(FILTER(_t , [RFI Measure] = _cur_type))


Then we can put this measure and field on the visual and we can get the result as follows:

vyueyunzhmsft_2-1693798374603.png

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Austin_Fisher , You need to use dynamic segmentation

refer

Power BI ABC Analysis using Window function, Dynamic Segmentation: https://youtu.be/A8mQND2xSR4

Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://youtu.be/EyL7KMw877Q

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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