cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## Countrows based on filtered measure type text

Hello Everyone,

I have been trying to solve this but i've been unsuccessful so far.

The following measure [perf_shift] calculates and prints in which shift i have the max performance, based on another measure [performance]:

``````VAR vals =
SUMMARIZE(
'Main_Table',
'Main_Table' [Shifts],
"Measure", [performance]
)
VAR measureMax = MAXX( vals, [performance] )
VAR perf_shift = CALCULATE(
MAXX(
FILTER( vals, [Measure] = measureMax ),
'Main_Table' [Shifts]
)
)

RETURN
perf_shift``````

Returns: (filter: Production Line and Product Type)

 Production Line Product Type Perf_Shift 1 type x 1st 1 type y 1st 1 type z 1st 2 type y 2nd

Now, what im trying to calculate is the total sum of 1st and 2nd shifts that I end up with based on the same filters.

Expected Result:

 Shift Count 1st 3 2nd 1

Thank you!

2 ACCEPTED SOLUTIONS
Super User

@Kebas_Leech , You need to do dynamic segmentation

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

Above is for single value what you need

range value example

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...

Super User

you need first to creat a disconnected table that contains { "1st", "2nd" } let's call it Shifts which you're going to use in the visual

then use the following measure

``````Count =
SUMX (
SUMMARIZE ( 'Main_Table', 'Main_Table'[Production], 'Main_Table'[LineProduct] ),
IF ( [Perf_Shift] = MAX ( Shifts[Shift] ), 1 )
)``````
3 REPLIES 3
Helper I

Both replies helped. Thank you so much!

Super User

you need first to creat a disconnected table that contains { "1st", "2nd" } let's call it Shifts which you're going to use in the visual

then use the following measure

``````Count =
SUMX (
SUMMARIZE ( 'Main_Table', 'Main_Table'[Production], 'Main_Table'[LineProduct] ),
IF ( [Perf_Shift] = MAX ( Shifts[Shift] ), 1 )
)``````
Super User

@Kebas_Leech , You need to do dynamic segmentation

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

Above is for single value what you need

range value example

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors