Skip to main content
cancel
Showing results for 
Search instead 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

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)

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)

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

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

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors