cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HugoDEVILLIER Regular Visitor
Regular Visitor

DAX : Percentage of a category per day

I've been trying for 3 days to find a way to add a calculated column that display the percentage of "closed" state per day.Screen Shot 09-17-19 at 03.57 PM.PNG

As you can see I have a "State" column , in it we can find "closed", "active","new"...etc
And a Date column , there can be multiple items per day


What I want is a calculated column that display the percentage of closed state (compared to total : closed,active,new...) per day. I can't find a way to do it, some help would be appreciated Smiley Sad

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: DAX : Percentage of a category per day

Hi @HugoDEVILLIER 

There are five identical rows in what you show. How is that to be taken into account? Try this calculated column:

 

NewCol =
DIVIDE (
    CALCULATE (
        COUNT ( Table1[State] ),
        Table1[State] = "Closed",
        ALLEXCEPT ( Table1, Table1[Date] )
    ),
    CALCULATE ( COUNT ( Table1[State] ), ALLEXCEPT ( Table1, Table1[Date] ) )
)

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: DAX : Percentage of a category per day

Hi @HugoDEVILLIER 

There are five identical rows in what you show. How is that to be taken into account? Try this calculated column:

 

NewCol =
DIVIDE (
    CALCULATE (
        COUNT ( Table1[State] ),
        Table1[State] = "Closed",
        ALLEXCEPT ( Table1, Table1[Date] )
    ),
    CALCULATE ( COUNT ( Table1[State] ), ALLEXCEPT ( Table1, Table1[Date] ) )
)

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

View solution in original post

HugoDEVILLIER Regular Visitor
Regular Visitor

Re: DAX : Percentage of a category per day

Sorry, this lines are not the same, my screenshot is just not wide enough, there is item ID's.
Each day we have the state of every item , and their state change with time Screen Shot 09-17-19 at 04.35 PM.PNG

I've tried you formula, adapted it and it finally works, thank you so much ! Smiley Very Happy

Helpful resources

Announcements
Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors