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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ninos-shiba
Resolver I
Resolver I

How to find the total for each day in order to find the % of noncompliance/total for each day?

Below is a sample of the data:

 

Date          Category
8/1/19       Compliant

8/1/19       Noncompliant

8/1/19       Compliant

8/3/19       Noncompliant

8/3/19       Compliant
8/5/19       Noncompliant

 

I want to tally up the grand total (noncompliance + compliance) for each day and then find the percentage of noncompliance over the total (noncompliance + compliance) for each day. Is there any way I could do this?

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@ninos-shibayes this is possible

 

Measure 2 =
DIVIDE (
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALLEXCEPT ( 'Table', 'Table'[Date] ),
        'Table'[CAT] = "NonCom"
    ),
    CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Date] ) )
)

Capture.PNG

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
smpa01
Super User
Super User

@ninos-shibayes this is possible

 

Measure 2 =
DIVIDE (
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALLEXCEPT ( 'Table', 'Table'[Date] ),
        'Table'[CAT] = "NonCom"
    ),
    CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Date] ) )
)

Capture.PNG

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Greg_Deckler
Super User
Super User

Probably something like:

 

Measure = DIVIDE(COUNTROWS(FILTER('Table',[Column1]="Noncompliant")),COUNTROWS('Table'),0)

See attached.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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