cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
superroy
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
BhaveshPatel
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
BhaveshPatel
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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

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.