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
kault
Helper II
Helper II

% of Total, by Group

I have a table that looks like this:

Account NameAccount OwnerDays Since Last Activity
Account AAllison140
Account BAllison20
Account CJim5
Account DJim10

 

I need to have a card that shows the % of their accounts with activity in the last 90 days. So, I need:

(count of accounts by account owner where days since last activity < 90) / (count of accounts by account owner)

 

The outcome should be Allison is 50% and Jim is 100%

 

How can I accomplish this?

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @kault ,

Here are the steps you can follow:

1. Use [Account Owner] as the slicer

vyangliumsft_0-1629250189886.png

2. Create measure.

Result =
var _countgroup=COUNTX(FILTER(ALL('Table'),'Table'[Account Owner]=MAX('Table'[Account Owner])),[Account Owner])
var _count90=COUNTX(FILTER(ALL('Table'),'Table'[Account Owner]=MAX('Table'[Account Owner])&&'Table'[Days Since Last Activity]<90),[Account Owner])
return
DIVIDE(_count90,_countgroup)

3. Result:

Select Allison, 50% is displayed.

vyangliumsft_1-1629250189887.png

Select Jim, 100% is displayed.

vyangliumsft_2-1629250189889.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @kault ,

Here are the steps you can follow:

1. Use [Account Owner] as the slicer

vyangliumsft_0-1629250189886.png

2. Create measure.

Result =
var _countgroup=COUNTX(FILTER(ALL('Table'),'Table'[Account Owner]=MAX('Table'[Account Owner])),[Account Owner])
var _count90=COUNTX(FILTER(ALL('Table'),'Table'[Account Owner]=MAX('Table'[Account Owner])&&'Table'[Days Since Last Activity]<90),[Account Owner])
return
DIVIDE(_count90,_countgroup)

3. Result:

Select Allison, 50% is displayed.

vyangliumsft_1-1629250189887.png

Select Jim, 100% is displayed.

vyangliumsft_2-1629250189889.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

selimovd
Super User
Super User

Hey @kault ,

 

the following measure should do that:

% of Total < 90 =
DIVIDE(
    CALCULATE(
        COUNTROWS( myTable ),
        myTable[Days Since Last Activity] < 90
    ),
    CALCULATE(
        COUNTROWS( myTable ),
        ALL( myTable[Account Name] )
    )
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

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.