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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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