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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Imran_1112
New Member

Single column formula for 2 options Complete and pending

Dear All,

 

Need help as i am new to Power BI.

 

To calculate % for in single column with text of (Complete and Pending) by using slicer, click on pending on slicer will give % for pending, when click on complete will give % for complete.

 

Thanks in advance

1 ACCEPTED SOLUTION

@Imran_1112 ,

I believe the below measure logic will work for you and it's a dynamic logic 🙂

Measure Logic = 
VAR __AllCount =
    CALCULATE ( COUNT ( Data[RFS] ), REMOVEFILTERS ( Data[RFS] ) )
VAR __Count =
    COUNT ( Data[RFS] )
RETURN
    DIVIDE ( __Count, __AllCount )




databi_nerd_0-1701757733613.png

 

 

If I resolve your issue please accept it as solution.
Thanks

 

View solution in original post

7 REPLIES 7
v-xiandat-msft
Community Support
Community Support

Hi @Imran_1112 ,

Below is my table:

vxiandatmsft_0-1701658282582.png

The following DAX might work for you:

Measure = 
   COUNT('Table'[RFS])/18

The final output is shown in the following figure:

vxiandatmsft_1-1701658349581.png

Best Regards,

Xianda Tang

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

 

 

Dear Xianda Tang,

 

Thanks for your reply, Its working well but i need to update total count every time when there is new site added. In your formula /18 has to be change every time when i upload new row or the row count increase.

Is there any way where it counts automatically the total rows (in this case 18) instead of putting manual.

 

Thanks again

COUNT('Table'[RFS])/18

 

@Imran_1112 ,

I believe the below measure logic will work for you and it's a dynamic logic 🙂

Measure Logic = 
VAR __AllCount =
    CALCULATE ( COUNT ( Data[RFS] ), REMOVEFILTERS ( Data[RFS] ) )
VAR __Count =
    COUNT ( Data[RFS] )
RETURN
    DIVIDE ( __Count, __AllCount )




databi_nerd_0-1701757733613.png

 

 

If I resolve your issue please accept it as solution.
Thanks

 

Thank you very much, it worked what i was looking for. You are amazing man.

 

Thanks for every 1 who tried to support me.

Imran_1112
New Member

Hi, Thanks for your reply,

Below is the text sample of few in that column containing 87 Rows in real, screenshot in below has the slicer for pending, complete and gauge. My aim is when i click on complete values will show on gauge as well as will show the percentage for completed, in other way when i select pending on slicer, it will reflect value on gauge and shows pending percentage.

 

Please help if its possible. Thanks again.

 

 

RFS
Completed
Completed
Completed
Completed
Completed
Completed
Pending
Completed
Pending
Pending
Pending
Pending
Pending
Pending
Pending
Pending
Pending
Pending

 

 

Imran_1112_0-1701437013326.png

 

 

@Imran_1112 ,
Please provide some sample data in file.

databi_nerd
Frequent Visitor

Hi @Imran_1112 ,

Can you please share some sample data or if possible the .pdix file with required logic?

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors