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

Conditional percentage of total a day

Hi,

 

I'm new to Power BI and I'm struggeling with my first visual/report.

I have a table 'Carts' like this:

 

OrderIdDate
08-11-2016 14:23:45
08-11-2016 14:23:45
12348-11-2016 14:23:45
56787-11-2016 14:23:45
07-11-2016 14:23:45
45217-11-2016 14:23:45
78967-11-2016 14:23:45
07-11-2016 14:23:45

 

Now I want a visual of the daily percentage with OrderId <> 0

 

8-11    33.33%

7-11    60.00%

 

How do I do this?

1 ACCEPTED SOLUTION
Community Champion
Community Champion

@superroy

 

You can achieve this with COUNT functions. OrderID field data type must be Text for this solution to work

 

Create below 3 measures to achieve the desired results.

 

Step1:

TotalRows:= COUNTROWS(Table1)           This will count all the rows in the table.

 

Step2: 

Allrows Greater than Zero:=CALCULATE(COUNTA(Table1[OrderId]),Table1[OrderId]>"0")

 

Step 3:

Dailypercentage:=DIVIDE([Allrows Greater than Zero],[TotalRows],2)

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

1 REPLY 1
Community Champion
Community Champion

@superroy

 

You can achieve this with COUNT functions. OrderID field data type must be Text for this solution to work

 

Create below 3 measures to achieve the desired results.

 

Step1:

TotalRows:= COUNTROWS(Table1)           This will count all the rows in the table.

 

Step2: 

Allrows Greater than Zero:=CALCULATE(COUNTA(Table1[OrderId]),Table1[OrderId]>"0")

 

Step 3:

Dailypercentage:=DIVIDE([Allrows Greater than Zero],[TotalRows],2)

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors