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
souvik900766
Helper IV
Helper IV

DAX-Count alphabets of a Measure created by IF condition and measures !

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 i.e. 18:-

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

Hi,

This measure returns 13 as the answer which is correct

L Count 1 = COUNTROWS(FILTER(VALUES(Sheet1[ctry_nm]),[LCE]="L"))

Hope this helps.

Untitled.png


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

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hello @souvik900766 ,
Can you share your pbix file after removing sensitive data?

Anonymous
Not applicable

Hello @souvik900766 ,
My measure works well.

cntrows =
CALCULATE( DISTINCTCOUNT('Count Alphabet'[Country] ), FILTER( 'Count Alphabet', 'Count Alphabet'[LCE] = "L" ) )
Capture 1.PNG

@Anonymous 
I dont know for me now its showing blank !!!

Anonymous
Not applicable

@souvik900766 
Can you share your pbix file after removing the sensitive data?

@Anonymous 
Hi PFA link
https://www.dropbox.com/s/5w1q12q8rchf9oj/Help.pbix?dl=0

My desired answer structure:-

 LCE
Country Combinations XXXX XX


Thanks !

Hi,

This measure returns 13 as the answer which is correct

L Count 1 = COUNTROWS(FILTER(VALUES(Sheet1[ctry_nm]),[LCE]="L"))

Hope this helps.

Untitled.png


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

@Ashish_Mathur ,
Hi,
It worked perfectly !!! Thanks...
Just a small request !
Just pull the Volume CY measure in the table and summarize the volume by L, C, E.
My desired result and structure:-
Capture.PNG

Thanks in advance !

You are welcome.


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

I have done it !

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.

Top Solution Authors