Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everyone, good evening! I hope you are all doing well.
I would like to share the challenge I am currently facing regarding the performance measures of the customer service team.
Context of the Challenge
Currently, I have three measures that need adjustment:
Objective
The main objective is to ensure that these measures display values only when the specified date period is met.
Rules for Each Measure:
Final Considerations
It is essential that the implementation of these rules ensures that the displayed values are consistent with the defined date range. If anyone has suggestions or ideas on how to approach this issue, I would appreciate any help. 💪
Photo:
Download link -> Base de testes.pbix - Google Drive
Solved! Go to Solution.
Hi @alanvicsansz ,
I've made a test for your reference:
1\Add two caculate column for Ocorrencias
Year = YEAR(Ocorrencias[data_ocorrencia])
Month = MONTH(Ocorrencias[data_ocorrencia])
2\Set these two measure
Ano atual =
VAR MaxYear=YEAR(CALCULATE(MAX(Ocorrencias[data_ocorrencia]),ALLSELECTED(Ocorrencias)))
Var MaxMonth= MONTH(CALCULATE(MAX(Ocorrencias[data_ocorrencia]),ALLSELECTED(Ocorrencias)))
RETURN
CALCULATE(COUNTROWS(ALLSELECTED(Ocorrencias)),Ocorrencias[Month]=SELECTEDVALUE(Calendario[MesNum]) && MaxYear=Ocorrencias[Year] && Ocorrencias[Month]<=MaxMonth )
Ano anterior =
VAR MaxYear=YEAR(CALCULATE(MAX(Ocorrencias[data_ocorrencia]),ALLSELECTED(Ocorrencias)))-1
Var MaxMonth= MONTH(CALCULATE(MAX(Ocorrencias[data_ocorrencia]),ALLSELECTED(Ocorrencias)))
RETURN
CALCULATE(COUNTROWS(ALLSELECTED(Ocorrencias)),Ocorrencias[Month]=SELECTEDVALUE(Calendario[MesNum]) && MaxYear=Ocorrencias[Year])
Best Regards,
Bof
Hi @alanvicsansz ,
I've made a test for your reference:
1\Add two caculate column for Ocorrencias
Year = YEAR(Ocorrencias[data_ocorrencia])
Month = MONTH(Ocorrencias[data_ocorrencia])
2\Set these two measure
Ano atual =
VAR MaxYear=YEAR(CALCULATE(MAX(Ocorrencias[data_ocorrencia]),ALLSELECTED(Ocorrencias)))
Var MaxMonth= MONTH(CALCULATE(MAX(Ocorrencias[data_ocorrencia]),ALLSELECTED(Ocorrencias)))
RETURN
CALCULATE(COUNTROWS(ALLSELECTED(Ocorrencias)),Ocorrencias[Month]=SELECTEDVALUE(Calendario[MesNum]) && MaxYear=Ocorrencias[Year] && Ocorrencias[Month]<=MaxMonth )
Ano anterior =
VAR MaxYear=YEAR(CALCULATE(MAX(Ocorrencias[data_ocorrencia]),ALLSELECTED(Ocorrencias)))-1
Var MaxMonth= MONTH(CALCULATE(MAX(Ocorrencias[data_ocorrencia]),ALLSELECTED(Ocorrencias)))
RETURN
CALCULATE(COUNTROWS(ALLSELECTED(Ocorrencias)),Ocorrencias[Month]=SELECTEDVALUE(Calendario[MesNum]) && MaxYear=Ocorrencias[Year])
Best Regards,
Bof
It worked perfectly, this was the result I was looking for, thank you very much. 💪🤝
Hello @alanvicsansz
To clarify your question further:
For the current year value, you seek the total values for the entire month corresponding to the latest selected date. For instance, if the latest selected date is February 22, 2023, the current year value would be the "sum of values for February 2023." I hope I have understood the logic for calculating the "Current Year" correctly.
Regarding the previous year, I did not fully grasp your requirements. Could you please rephrase and provide some examples to aid my understanding of the issue?
Additionally, it would be helpful if you could provide a snapshot of the "Expected Answer" or data to accompany the explanation of the "Previous Year" calculation logic.
Thank you,
Udit
Let me know if the screenshot helps. If you need more details, feel free to ask and I'll be happy to provide more info!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
17 | |
10 | |
10 | |
8 | |
6 |
User | Count |
---|---|
18 | |
16 | |
15 | |
12 | |
10 |