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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

calculate base on a variable of a measure

Hello 

 

I would like to know how could I get a total count of how many values I have displayed in my matrix like below example:

 

LINESday 1day2day 3total
top1    
   top1.1blankblank5.671

 

the values of the matrix are comming from a measure: VAR A = 

AVERAGEX(VALUES(table[Line), CALCULATE(SUM(times[TimeTotal])))
 
I have the function INSCOPE to display the subtotal per row and per column. 
In column 
VAR Y = SWITCH(
TRUE(),
[User Selection Summary] = "top1.1", A/X,
 
I need that X to be the COUNT of values per row (in this case 1)
 
I think I could do a COUNTAX but not sure how because in my table I have per day several hours, I sum up all and in the matrix display per day (based on this measure). 
 
Hope you can help . thanks
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a measure with summarize with all rows and columns

example

measure =

var _tab = summarize(Table, Dim[dim1], Dim2[dim2], "_1", [measure])

return 

countx(_tab, _1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Create a measure with summarize with all rows and columns

example

measure =

var _tab = summarize(Table, Dim[dim1], Dim2[dim2], "_1", [measure])

return 

countx(_tab, _1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

One last thing, 

 

As you can see below  the total in the corner is 35 so the value I got is 15.10%. 

However, this value I need it to be the sum of the 3 items (in this case) divided by 3items  OR the sum of each value per day divided by number of days. 

 

prueba1_0-1621412702783.png

do you have any idea to sort out this problem?

 

thanks!

Anonymous
Not applicable

It worked!

Thanks 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors