Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have created the following measure, which I then implemented in a line graph. However, the measuer is only showing the total sum for every month, and not the real sum/month.
Any ideas on how to fix this?
Count Forms Category Test 2023 =
CALCULATE(COUNT('lead'[Forms category]),
ALL(),
'lead'[Country]="Test Form",
'lead'[Forms category]="Test Category",
DATESBETWEEN(Datum[Date],DATE(2023,1,1),DATE(2023,8,31)
))
When I'm not using "time" in my measure but a slicer, it's working fine (but I want to it work without date slicer).
The actual goal is to display two graphs, one for 2023 and one for 2024 in the same 12 months chart.
Thanks for your help!
Solved! Go to Solution.
Hi @cn4422
Try using VALUES(Datum[Date]. [Month]) in your measure to ensure that the data is summarized by month.
Count Forms Category Test 2023 by Month =
CALCULATE(
COUNT('lead'[Forms category]),
'lead'[Country] = "Test Form",
'lead'[Forms category] = "Test Category",
DATESBETWEEN(Datum[Date], DATE(2023, 1, 1), DATE(2023, 12, 31)),
VALUES(Datum[Date].[Month])
)
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @cn4422
Try using VALUES(Datum[Date]. [Month]) in your measure to ensure that the data is summarized by month.
Count Forms Category Test 2023 by Month =
CALCULATE(
COUNT('lead'[Forms category]),
'lead'[Country] = "Test Form",
'lead'[Forms category] = "Test Category",
DATESBETWEEN(Datum[Date], DATE(2023, 1, 1), DATE(2023, 12, 31)),
VALUES(Datum[Date].[Month])
)
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much, that did the trick! 🤗
One more question, if I may:
With your help I've created this measure for 2024:
Hi @cn4422
The problem you are experiencing is due to the use of the ALL('Datum') function, which ignores all filters in the Datum table. Refer to link: ALL function (DAX) - DAX | Microsoft Learn.
Drop ALL(Datum) and try the following DAX:
Count Forms Category DE 2023 SPLY TEst 2 plus date slicer =
CALCULATE(
COUNT('lead'[Forms category]),
'lead'[Country] = "Test Form",
'lead'[Forms category] = "Test Category",
SAMEPERIODLASTYEAR(Datum[Date])
)
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ah, sure... 🙈
Thank you so much, it's working fine! 👍
Kind regards,
Michael
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |