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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jbqrn
Helper I
Helper I

Obtaining the correct % of a column when using a slicer

Hi everyone,
I am trying to show the Nº of defficiencies (OK, KO, Pending) of a list of controls and I made the following measure: 

Defficiencies = 
DIVIDE(
CALCULATE(COUNT('Mapeo Heatmap'[Control Code]),'Mapeo Heatmap'[Rating conclusion]<>"OK" )
,
COUNT('Mapeo Heatmap'[Control Code])
)


It has to show the amount of controls that are not right, all good when using the slicer of "Control" or "Process", t
he problem appears when filtering with the SLICER [Rating conclusion] by KO, OK or Pending, that returns wrong data.
 
All Controls - correct measure 119/1848 = 6,44 % (119 no OK, 1729 OK)
jbqrn_6-1656502221024.png

OK - it has to show 0% of defficiencies - 0 controls / 1729 controls (filtered by the SLICER rating conclusion = "OK")

 
jbqrn_4-1656502070212.png

Pending - it has to show 100% - 31 controls "Pending"/31 controls (filtered by the SLICER rating conclusion = "PENDING")

jbqrn_2-1656501991377.png

KO - it has to show 100% - 88 controls "KO"/88 controls (filtered by the SLICER rating conclusion = "KO")

jbqrn_3-1656502035396.png


Data:

EntidadControl CodeRating conclusion
CorporativoELC-01KO
CorporativoELC-02Pending
CorporativoELC-03OK
CorporativoELC-04OK
CorporativoELC-05OK
CorporativoELC-06OK
CorporativoELC-07OK
CorporativoELC-08OK
CorporativoELC-09OK
CorporativoELC-10OK
CorporativoELC-11Pending
CorporativoELC-12OK
CorporativoELC-13Pending

 

Any possible solution?
Thanks in advice!!

 

3 REPLIES 3
SpartaBI
Community Champion
Community Champion

@jbqrn TRY:

Defficiencies = 
DIVIDE(
CALCULATE(COUNT('Mapeo Heatmap'[Control Code]),'Mapeo Heatmap'[Rating conclusion]<>"OK" )
,
CALCULATE(COUNT('Mapeo Heatmap'[Control Code]), REMOVEFILTERS('Mapeo Heatmap'[Rating conclusion])
)



2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Hi @SpartaBI, thanks for the solution!

 

The problem is that if I apply the remove filters argument in the division, the number that is returned doesn't change when filtering with that slicer...
😞

 

SpartaBI
Community Champion
Community Champion

@jbqrn no worries, I will PM you now

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.