- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Need to calculate base on DATESBETWEEN
I am new to Power BI and I am looking for the following solution:
I have a table with Date and Status
Example
Date Status
Dec-01-2010 Accepted
Jan-01-2011 Accepted
Jan-02-2011 Decline
Jan-03-2011 Accepted
Feb-01-2011 Accepted
Feb-02-2011 Decline
Mar-01-2012 Decline
I need to get the following result:
You can see that I only need the data with DATEBETWEEN Jan-01-2011 to Feb-02-2011.
Month #Total_Status #Accepted
Jan11 3 2
Feb11 2 1
Looks like I can use a New Messure to calculate by month the total number of Status and the total number of Accepted under status but needs to be only with the days between
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @TiaCamilian ,
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
# of Accepted = var MinDate = MIN('Table'[Date]) var MaxDate = MAX('Table'[Date]) var CountStatus = CALCULATE(Counta('Table'[Status]),FILTER(All('Table'),'Table'[Date]>MinDate && 'Table'[Date]<MaxDate),'Table'[Status]="Accepted") return CountStatus ---------------------------------------- # of Status = var MinDate = MIN('Table'[Date]) var MaxDate = MAX('Table'[Date]) var CountStatus = CALCULATE(Counta('Table'[Status]),FILTER(All('Table'),'Table'[Date]>MinDate && 'Table'[Date]<MaxDate)) return CountStatus
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @TiaCamilian ,
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
# of Accepted = var MinDate = MIN('Table'[Date]) var MaxDate = MAX('Table'[Date]) var CountStatus = CALCULATE(Counta('Table'[Status]),FILTER(All('Table'),'Table'[Date]>MinDate && 'Table'[Date]<MaxDate),'Table'[Status]="Accepted") return CountStatus ---------------------------------------- # of Status = var MinDate = MIN('Table'[Date]) var MaxDate = MAX('Table'[Date]) var CountStatus = CALCULATE(Counta('Table'[Status]),FILTER(All('Table'),'Table'[Date]>MinDate && 'Table'[Date]<MaxDate)) return CountStatus
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your help.
Do I create a new table or messure for your example.
Sorry I am new at this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @TiaCamilian ,
Here is my pbix, Number accepted I didn't create a new table, just used your data. Did create two new measures. You should be able to put your table and column names into my example and have it work.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the solution and is working well
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do we tell that "You can see that I only need the data with DATEBETWEEN Jan-01-2011 to Feb-02-2011"?
Nathaniel
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
09-02-2024 11:54 PM | |||
10-14-2024 06:30 AM | |||
08-29-2024 12:51 PM | |||
12-17-2018 08:48 AM | |||
09-04-2024 03:05 AM |