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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
souvik900766
Helper IV
Helper IV

Count Alphabets in if Condition by measure.

Hi ! I want to count or summarize the alphabets created from the if statement by a measure !
My Data:-
My measure of the if statement:-

LCE _1 =
IF([M]>=1,"",IF(Share(Val)]>0.30 && [M]>=0.01,"L",
IF( [Share(Val)]>0.10 && [M]>=0.01,"C",
IF([Share(Val)]<0.10 || [M]<=0.01,"E"))))
Both [M] & [Share(Val)] are measures !
 
CountryCategoryLCEVolumeValue
Country 1Category 1C03
Country 2Category 1L04
Country 3Category 1C06
Country 4Category 1C115
Country 5Category 1C115
Country 6Category 1C00
Country 7Category 1L02
Country 8Category 1L04
Country 9Category 1C00
Country 10Category 1E02
Country 11Category 1C03
Country 12Category 1C01
Country 13Category 1C114
Country 14Category 1L04
Country 15Category 1L06
Country 16Category 1C01
Country 17Category 1L7143
Country 18Category 1E00

 

The LCE column is a measure created with IF statement:-

I want to count or summarize , that number of countries coming under L, C, E and also the summation of Volume and Value under L,C,E.
My desired answer and structure:-

 LCE
Country Combinations6102
Volume7.83.60.1
Value164571.7

 

I used this measue but it is giving the total count of LCE:-

cntrows = CALCULATE(DISTINCTCOUNT(country),FILTER(Table,[LCE]="L"))

Thanks in advance !

2 REPLIES 2
souvik900766
Helper IV
Helper IV

Hi !
My LCE column that you see is based out of a LOGICAL IF Measure with certain condition.Then how can I use count?

Anonymous
Not applicable

Hello @souvik900766 
You can create a calculated table by using the below calculation.
CountAlphabet =
UNION (
SUMMARIZE (
'Count Alphabet',
"Values", "Country Combinations",
"L", CALCULATE ( COUNT ( 'Count Alphabet'[LCE] ), 'Count Alphabet'[LCE] = "L" ),
"C", CALCULATE ( COUNT ( 'Count Alphabet'[LCE] ), 'Count Alphabet'[LCE] = "C" ),
"E", CALCULATE ( COUNT ( 'Count Alphabet'[LCE] ), 'Count Alphabet'[LCE] = "E" )
),
SUMMARIZE (
'Count Alphabet',
"Values", "Volume",
"L", CALCULATE ( SUM ( 'Count Alphabet'[Volume] ), 'Count Alphabet'[LCE] = "L" ),
"C", CALCULATE ( SUM ( 'Count Alphabet'[Volume] ), 'Count Alphabet'[LCE] = "C" ),
"E", CALCULATE ( SUM ( 'Count Alphabet'[Volume] ), 'Count Alphabet'[LCE] = "E" )
),
SUMMARIZE (
'Count Alphabet',
"Values", "Value",
"L", CALCULATE ( SUM ( 'Count Alphabet'[Value] ), 'Count Alphabet'[LCE] = "L" ),
"C", CALCULATE ( SUM ( 'Count Alphabet'[Value] ), 'Count Alphabet'[LCE] = "C" ),
"E", CALCULATE ( SUM ( 'Count Alphabet'[Value] ), 'Count Alphabet'[LCE] = "E" )
)
)
Capture3.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.