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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
geo_lan
New Member

Measures to calculate Count & Percentage based on summarised values

Hello,

 

I am looking for assistance please regards to the creation of 2 measures (to be used in card visuals) - one that displays a Count of Cost Centres (AB_CC) that are within budget, and another that displays the percentage of cost centres that are within budget. Please see below screenshot of an example table (ACCOUNT_BALANCES) to illustrate my issue:

 

geo_lan_0-1715789916394.png

 

From this table we can see the total variance for each cost centre is as follows:

 

geo_lan_2-1715795295549.png

 

So in total,   3 Cost Centres are under budget, which is   60% of all cost centres. These are the 2 measures I would like to formulate please if possible.

 

I have attempted some DISTINCTCOUNT and FILTER formulas, but in the case of the Count summation they keep returning a result of 4 which is incorrect.

 

Thank you

 
 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@geo_lan 

Pls try this

 

Measure =
var T=SUMMARIZE('Table','Table'[AB_CC],"ACTUAL2",SUM('Table'[ACTUAL]),"BUDGET2",SUM('Table'[BUDGET]))
RETURN COUNTROWS(FILTER(T,[ACTUAL2]<[BUDGET2]))
 
Measure 2 = [Measure]/DISTINCTCOUNT('Table'[AB_CC])
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@geo_lan 

Pls try this

 

Measure =
var T=SUMMARIZE('Table','Table'[AB_CC],"ACTUAL2",SUM('Table'[ACTUAL]),"BUDGET2",SUM('Table'[BUDGET]))
RETURN COUNTROWS(FILTER(T,[ACTUAL2]<[BUDGET2]))
 
Measure 2 = [Measure]/DISTINCTCOUNT('Table'[AB_CC])
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Yes that works, nice one ryan_mayu! Thank you

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.