The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi there,
I have a table looking like this:
GTIN | Date | Amount | Revenue |
4004231481559 | 17.04.2024 | 20 | 499,20 |
4004338782047 | 26.04.2024 | 2 | 14,20 |
4004625602003 | 04.04.2024 | 1 | 192,47 |
4004764007967 | 07.05.2024 | 60 | 101,95 |
4004764007967 | 30.04.2024 | 50 | 85,00 |
4004764007967 | 02.04.2024 | 20 | 34,00 |
4004764007967 | 26.04.2024 | 20 | 34,00 |
4004764007967 | 17.04.2024 | 10 | 17,00 |
4004764007974 | 07.05.2024 | 10 | 16,99 |
4004764007981 | 30.04.2024 | 100 | 170,00 |
4004764007981 | 26.04.2024 | 20 | 34,00 |
4004764007981 | 07.05.2024 | 10 | 16,99 |
I have built a visual where the GTINs are in a pivotv showing the revenue depending on the months of the dates.
But I would like to show only those entries, which have values in both months. So the end result should be looking like this:
GTIN | April | May |
4004764007967 | 170 | 101,95 |
4004764007981 | 204 | 16,99 |
Following measures have I tried, but did not worked yet:
1.Create a Measure for April Revenue
April Revenue =
CALCULATE(
SUM(Sheet1[Revenue]),
FILTER(
ALL(Sheet1),
MONTH(Sheet1[Date]) = 4
)
)
2.Create a Measure for May Revenue
May Revenue =
CALCULATE(
SUM(Sheet1[Revenue]),
FILTER(
ALL(Sheet1),
MONTH(Sheet1[Date]) = 5
)
)
3.Create a Measure to Check if Both Months Have Values*
Both Months Have Values =
IF(
NOT(ISBLANK([April Revenue])) && NOT(ISBLANK([May Revenue])),
1,
0
)
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
@johnbasha33 I have tried this already, but the first two measures deliver the sum of revenue for all articles, not of each article. So that does not work for my issue.
Any other ideas?