cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

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.

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
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:

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

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:

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

Super User

Hi,

Regards,
Ashish Mathur
http://www.ashishmathur.com
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