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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Dart1
Regular Visitor

Profit rate on a daily basis

Hi everyone,

Newbie here and need help. I have a data of dates and profits/losses. I need to get a rate of profits to losses based on end of day result. Below is an example of my data. i have several inputs for the same dates and have a result for each day under daily result column. My result rate is 67% overall (two positive daily results and 1 negative result).

 

How can I achieve thie result rate with power BI?

 

Thanks in advance!

 

Dart1_0-1674857028733.png

 

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format the can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Here you go:

 

DateSales
11/2/202210
11/2/202220
11/2/2022-50
11/2/202230
11/2/2022-60
11/2/202215
11/2/202222
11/2/202237
11/3/202256
11/3/2022-69
11/3/2022-85
11/3/202255
11/3/2022-90
11/3/2022100
11/3/2022-200
11/3/2022150
11/4/2022-120
11/4/2022130
11/4/202245
11/4/2022-50
11/4/202265
11/4/202272
11/4/2022100
11/4/2022-85
11/4/202215

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you so much! Exactly what I was looking for!

 

One more question if this is not too much to ask:

Some of my data has also time in it and when I check those data then there seems to be an issue with the results.

 

Below is an example for those dates and not sure how to make this work? Thanks again for your time!

Also, I'm using a slicer that is usign the main date data as slicer input and when I change the date from slicer then the ratio doesn't change. Maybe due to using the new table date? How can I fix this?

1/3/2023 7:53:45 AM
1/3/2023 11:01:23 AM
1/3/2023 11:12:43 AM
1/3/2023 12:07:20 PM
1/4/2023 6:44:37 AM
1/4/2023 6:53:22 AM
1/4/2023 7:55:56 AM
1/4/2023 8:04:37 AM
1/4/2023 8:19:57 AM
1/4/2023 9:02:55 AM
1/4/2023 9:30:33 AM
1/4/2023 12:08:22 PM
1/5/2023 6:59:48 AM
1/5/2023 8:33:35 AM
1/5/2023 10:23:01 AM
1/5/2023 11:17:44 AM
1/5/2023 11:56:11 AM
1/6/2023 7:35:23 AM
1/6/2023 8:59:34 AM
1/6/2023 9:59:03 AM
1/6/2023 10:51:19 AM
1/6/2023 11:08:23 AM
1/6/2023 11:08:56 AM
1/6/2023 12:51:26 PM
1/9/2023 6:58:49 AM
1/9/2023 7:58:12 AM
1/9/2023 8:17:59 AM
1/9/2023 9:07:51 AM
1/9/2023 10:30:34 AM
1/9/2023 10:35:40 AM
1/9/2023 11:30:57 AM
1/10/2023 6:21:37 AM
1/10/2023 6:34:31 AM
1/10/2023 7:14:46 AM
1/10/2023 7:15:00 AM
1/10/2023 8:13:37 AM
1/10/2023 8:22:29 AM
1/10/2023 8:22:46 AM
1/10/2023 10:16:30 AM
1/10/2023 10:51:18 AM
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

You are welcome.  In the Query Editor, change the datetype to date.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Dart1 

Maybe try this in a card.

 

z = 
DIVIDE(
    COUNTROWS(
        FILTER(
            ADDCOLUMNS(
                VALUES( 'DataTable'[Date] ),
                "_Sales", CALCULATE( SUM( 'DataTable'[Sales] ) )
            ),
            [_Sales] > 0
        )
    ),
    DISTINCTCOUNT( 'DataTable'[Date] )
)

 

smpa01
Super User
Super User

@Dart1  you need a measure as following

 

 

Measure = CALCULATE(SUM(tbl[sale]),ALLEXCEPT(tbl,tbl[date]))

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Thanks for your time! 

 

I added the above measure to my table and the result of this measure is as below.   Not really representing the 67% rate. Maybe I need to try to expain better on my end. I have three days above and every day has several results in it.. At the end of the day, each day has a profit or loss result. In the table above I have 2 profit days and 1 loss day. This brings a 67% daily rate.  Power BI needs to calculate every individial day and come up with a result for each day. Then needs to calculate the rate of profit resulted days' count to the overall different days count.

 

Dart1_0-1674863230396.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.