The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Good morning
I have the following problem:
I have created this graph of Orders accumulated over several years using this measure:
What I need is that in the year 2021, when it reaches today, instead of the flat line continuing (because there is no data yet), that the line is cut there and does not continue.
It's possible?. Thank you
Jose
HI @Anonymous,
According to your description, it sounds like you want to show the line graph continue even if there are no match records with the next time periods? If that is the case, I think the time intelligence function may not suitable for your requirement.
For this scenario, you can use the date function to manually define the filter ranges and change the compare operator to 'less than and equal to' current date(<=) then the line graph will be shown on the following time period even if no records existed.
Accumulated orders =
VAR currDate =
MAX ( 'Master Calendar'[Date] )
RETURN
CALCULATE (
SUM ( 'Total Order Entry'[Amount] ),
FILTER (
ALLSELECTED ( 'Total Order Entry' ),
YEAR ( [Date] ) = YEAR ( currDate )
&& [Date] <= currDate
)
)
Regards,
Xiaoxin Sheng
Hello, thanks for the help but it does not fix the problem.
I have used your measurement:
But the result is the same:
And what I was looking for is that, since there is still no data from 12/2021, that data should be 0 or empty instead of repeating the same data that there is in 11/2021
Hi @Anonymous,
Perhaps you can try to add an if statement to check the current axis date and max available fact table date and use it as a filter to prevent the calculation on not existing date ranges:
Accumulated orders =
VAR currDate =
MAX ( 'Master Calendar'[Day] )
VAR maxDate =
CALCULATE (
MAX ( 'Total Entry Orders'[Date Entry (ERDAT)] ),
FILTER (
ALLSELECTED ( 'Total Entry Orders' ),
YEAR ( 'Total Entry Orders'[Date Entry (ERDAT)] ) = YEAR ( currDate )
)
)
RETURN
IF (
currDate <= maxDate,
CALCULATE (
SUM ( 'Total Order Entry'[Amount] ),
FILTER (
ALLSELECTED ( 'Total Entry Orders' ),
YEAR ( 'Total Entry Orders'[Date Entry (ERDAT)] ) = YEAR ( currDate )
&& 'Total Entry Orders'[Date Entry (ERDAT)] <= currDate
)
)
)
Regards,
Xiaoxin Sheng
Dear Sir,
I tried the formula, but it gives an error of: "The end of the entry has been reached":
Greetings
Jose
Hi @josefmc08,
This issue seems more related to the brackets.
After check the snapshot, I found you add three more ')' at the end of the formula so that power bi cannot recognize and process this expression.
Regards,
Xiaoxin Sheng
Sorry, it doesn't work, it gives error and nothing comes out.
@Syndicate_Admin , Create a YTD measure and take the month axis and year on Legend
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Good morning
I'm afraid the solution doesn't work, it's the same:
What I would need is for future dates not to appear. For example, in the table below the graph, the months of November and December 2021 should come out empty because we have not yet arrived.
Thank you for your help
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
81 | |
78 | |
44 | |
39 |
User | Count |
---|---|
150 | |
116 | |
68 | |
64 | |
57 |