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
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.

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.