Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello!
I have a sample volume table below and another table that is my calendar table.
Date | Vol | Client |
1-Jun-22 | 10 | A |
1-Jun-22 | 20 | A |
2-Jun-22 | 30 | B |
3-Jun-22 | 20 | A |
4-Jun-22 | 30 | A |
4-Jun-22 | 10 | B |
5-Jun-22 | 30 | B |
6-Jun-22 | 40 | A |
7-Jun-22 | 10 | B |
1-May-22 | 10 | A |
1-May-22 | 20 | A |
2-May-22 | 30 | B |
3-May-22 | 20 | A |
4-May-22 | 30 | A |
4-May-22 | 10 | B |
5-May-22 | 30 | B |
6-May-22 | 40 | A |
7-May-22 | 10 | B |
1-Jun-21 | 10 | A |
1-Jun-21 | 20 | A |
2-Jun-21 | 30 | B |
3-Jun-21 | 20 | A |
4-Jun-21 | 30 | A |
4-Jun-21 | 10 | B |
5-Jun-21 | 30 | B |
6-Jun-21 | 40 | A |
7-Jun-21 | 10 | B |
Is it possible to create this page:
I have a slicer in the page that is always set to "Today" or the current date. I need in the same page a 'line and clustered column chart' that should show 3 fields - the volume of current month (Ex. June 2022), the volume of previous month (Ex. May 2022), and volume of same month as of current month but previous year (June 2021). The x-axis would then be the days of the month.
Another catch is that if the current date is if it's the 1st day of the month (Ex. July 1, 2022), it should treat the previous date (June 30, 2022) as the current month so that even on Day 1 of the month, the chart would still be able to show the previous month (June 2022), the previous-previous month (May 2022), and the same month as of previous month but previous year (June 2021).
See sample illustration below:
Solved! Go to Solution.
Hi @newgirl ,
Please try these measures:
IsInCurrentMonth =
IF (
DAY ( TODAY () ) = 1,
COUNTROWS (
FILTER (
'Calendar',
'Calendar'[Date]
>= TODAY () - 1
&& 'Calendar'[Date] <= EOMONTH ( TODAY (), 0 )
)
),
COUNTROWS (
FILTER ( 'Calendar', 'Calendar'[YearMonthNum] = FORMAT ( TODAY (), "yyyymm" ) )
)
)
current month =
CALCULATE (
SUM ( 'Table'[Vol] ),
FILTER ( 'Calendar', [IsInCurrentMonth] <> BLANK () )
)
previous month =
VAR Cur_month =
CALCULATE (
SUM ( 'Table'[Vol] ),
FILTER (
ALLSELECTED ( 'Calendar' ),
'Calendar'[Date] = EDATE ( MAX ( 'Calendar'[Date] ), -1 )
)
)
RETURN
IF ( [IsInCurrentMonth] <> BLANK (), Cur_month )
same month as of current month but previous year =
VAR sameperiodlastyear_month =
CALCULATE (
SUM ( 'Table'[Vol] ),
SAMEPERIODLASTYEAR('Calendar'[Date])
)
RETURN
IF (
[IsInCurrentMonth] <> BLANK(), sameperiodlastyear_month
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @newgirl ,
Please try these measures:
IsInCurrentMonth =
IF (
DAY ( TODAY () ) = 1,
COUNTROWS (
FILTER (
'Calendar',
'Calendar'[Date]
>= TODAY () - 1
&& 'Calendar'[Date] <= EOMONTH ( TODAY (), 0 )
)
),
COUNTROWS (
FILTER ( 'Calendar', 'Calendar'[YearMonthNum] = FORMAT ( TODAY (), "yyyymm" ) )
)
)
current month =
CALCULATE (
SUM ( 'Table'[Vol] ),
FILTER ( 'Calendar', [IsInCurrentMonth] <> BLANK () )
)
previous month =
VAR Cur_month =
CALCULATE (
SUM ( 'Table'[Vol] ),
FILTER (
ALLSELECTED ( 'Calendar' ),
'Calendar'[Date] = EDATE ( MAX ( 'Calendar'[Date] ), -1 )
)
)
RETURN
IF ( [IsInCurrentMonth] <> BLANK (), Cur_month )
same month as of current month but previous year =
VAR sameperiodlastyear_month =
CALCULATE (
SUM ( 'Table'[Vol] ),
SAMEPERIODLASTYEAR('Calendar'[Date])
)
RETURN
IF (
[IsInCurrentMonth] <> BLANK(), sameperiodlastyear_month
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
80 | |
76 | |
70 | |
69 | |
54 |
User | Count |
---|---|
104 | |
99 | |
92 | |
78 | |
69 |