Hello,
I'm facing some challange with a topic and i'd like some help.
I have two work on a report with only 1 table. (Issues)
1 - I have a date slicer ('Issues'[Criado]), that i use to filter tickets in my report.
2 - Also have two calculate fields, a date min (_date_min), and a date max (_date_max),that i can get the dates selected on date slicer.
3 - Also a datediff calculate field, where i can get a period of consulting.
The challange is:
Based on a date selected in the slicer, get the actual total of issues, and compare with the total of issues previous based in the slicer.
(Example:
1 - Date set in Slicer: 09/09/2022 to 10/09/2022
2 - Calculate the DATEDIFF. (in that case will be 1)
3 - Get the total of actual Issues.
4 - Based in DATEDIFF, the previsous date to get comparison: 08/09/2022 to 09/09/2022
5 - Get the total of Issues in previous date.
6 - Use the total of issues in previous date as GOAL to comparate the total of actual issues.
)
Now i'm stuck in get the total of previous tickets.
Solved! Go to Solution.
Thanks for reaching out to us.
Use the selectedvalue() function to get the date in the slicer, and then use the set date range to get the count in the corresponding range, you can refer to this solution, Running total for a prior year based on slicer Dat... - Microsoft Power BI Community
Transactions Cumulative Current Period (last year) =
IF (
COUNTROWS ( 'Confirmed Transactions' ) > 0,
CALCULATE (
[Transactions Cumulative Current Period],
SAMEPERIODLASTYEAR (
FILTER ( ALLSELECTED ( Dates[Date] ), 'Dates'[Date] <= MAX ( Dates[Date] ) )
)
)
)
or something like
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,max(dateadd(date[date]),-1,year))))
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Thanks for reaching out to us.
Use the selectedvalue() function to get the date in the slicer, and then use the set date range to get the count in the corresponding range, you can refer to this solution, Running total for a prior year based on slicer Dat... - Microsoft Power BI Community
Transactions Cumulative Current Period (last year) =
IF (
COUNTROWS ( 'Confirmed Transactions' ) > 0,
CALCULATE (
[Transactions Cumulative Current Period],
SAMEPERIODLASTYEAR (
FILTER ( ALLSELECTED ( Dates[Date] ), 'Dates'[Date] <= MAX ( Dates[Date] ) )
)
)
)
or something like
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,max(dateadd(date[date]),-1,year))))
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Please share sample non-confidential data or a link to a PBIX file.
Proud to be a Super User!
Paul on Linkedin.