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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
AlB
Super User
Super User

Hi @Anonymous 

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
AlB
Super User
Super User

Hi @Anonymous 

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

 

Anonymous
Not applicable

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.