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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Counting and getting the total % of the greater than value

Hi there,

I want to create a measure that counts an ID value and checks if the ID value is greater than 1, if it's greater than 1 then get the % total. 

the id value is called uk_id in [tablename]. Is there a way that a measure can count the number of rows, then calculate how many are greater than 1 compared to 1 which then shows a % total? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please refer to my pbix file to see if it helps you.

Create a measure.

Measure =
VAR _count =
    CALCULATE ( COUNTROWS ( 'vs_id data' ), ALL ( 'vs_id data' ) )
VAR _countnot1 =
    CALCULATE (
        COUNT ( 'vs_id data'[vs_id] ),
        FILTER ( ALL ( 'vs_id data' ), 'vs_id data'[vs_id] > 1 )
    )
VAR _divide = _countnot1 / _count
RETURN
    IF ( MAX ( 'vs_id data'[vs_id] ) = 1, MAX ( 'vs_id data'[vs_id] ), FORMAT(_divide,"Percent"))

vpollymsft_0-1656556500285.png

If I have misunderstood your meaning, please provide more details with your deisred output( Preferably output in image form with text explanation).

 

Best Regards

Community Support Team _ Polly

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

Please refer to my pbix file to see if it helps you.

Create a measure.

Measure =
VAR _count =
    CALCULATE ( COUNTROWS ( 'vs_id data' ), ALL ( 'vs_id data' ) )
VAR _countnot1 =
    CALCULATE (
        COUNT ( 'vs_id data'[vs_id] ),
        FILTER ( ALL ( 'vs_id data' ), 'vs_id data'[vs_id] > 1 )
    )
VAR _divide = _countnot1 / _count
RETURN
    IF ( MAX ( 'vs_id data'[vs_id] ) = 1, MAX ( 'vs_id data'[vs_id] ), FORMAT(_divide,"Percent"))

vpollymsft_0-1656556500285.png

If I have misunderstood your meaning, please provide more details with your deisred output( Preferably output in image form with text explanation).

 

Best Regards

Community Support Team _ Polly

 

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

SpartaBI
Community Champion
Community Champion

@Anonymous hey, can you share a sample data (copy paste a table here) and the write the desired result and the logic and I will write you back with the DAX measure

Anonymous
Not applicable

Hi @SpartaBI here is a sample dataset below, this mimmicks the exact table columns that I'm working with, the only important column, however, is the vs_id column. 

pl_iduseridva_idvs_id
17731361832141
17949321832141
18171081832141
18215721832141
18764981832141
18767021832141
18771711832141
18772441832141
18773901832141
18779711832141
18791761832141
18798151832141
18798741832141
18800281832141
18807001832141
18807061832141
18814621832141
18814711832141
18815861832141
18818531832141
27731361832142
27949321832142
28171081832142
28215721832142
28764981832142
28767021832142
28771711832142
28772441832142
28773901832142
28779711832142
28791761832142
28798151832142
28798741832142
28800281832142
28807001832142
28807061832142
28814621832142
38814711832143
38815861832143
48818531832144

 

Edit: Sorry I'm not sure why the table is formatting the way it is (so close together)

Here is the link to download the file if that's easier https://drive.google.com/file/d/1xapK-sJsXv7R2WEA-IoTFht4qgN1KjwO/view?usp=sharing

 

@Anonymous I pm you now

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.