Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello Folks ! Please help me with the following doubt !
I have a slicer which filters Months. I want the output on barchart such as :- If I select June, Bar chart should show me the Month - March, April, May, June, July, Aug, Sept, December, June Previous Year and December Previous Year.
Thank you in advance.
Solved! Go to Solution.
Hi @Madhura29 ,
You can create a seperate table with month name, then create the specified measure like
Measure =
IF (
ISFILTERED ( MonthName[Month] ),
SWITCH (
SELECTEDVALUE ( MonthName[Month] ),
"June",
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
(
[Date] < DATE ( YEAR ( TODAY () ), 10, 1 )
&& [Date] >= DATE ( YEAR ( TODAY () ), 3, 1 )
)
|| (
[Date] >= DATE ( YEAR ( TODAY () ), 12, 1 )
&& [Date] <= DATE ( YEAR ( TODAY () ), 12, 31 )
)
|| (
[Date]
>= DATE ( YEAR ( TODAY () ) - 1, 6, 1 )
&& [Date]
<= DATE ( YEAR ( TODAY () ) - 1, 6, 30 )
)
|| (
[Date]
>= DATE ( YEAR ( TODAY () ) - 1, 12, 1 )
&& [Date]
<= DATE ( YEAR ( TODAY () ) - 1, 12, 31 )
)
)
)
),
SUM ( 'Table'[Value] )
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Madhura29 ,
You can create a seperate table with month name, then create the specified measure like
Measure =
IF (
ISFILTERED ( MonthName[Month] ),
SWITCH (
SELECTEDVALUE ( MonthName[Month] ),
"June",
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
(
[Date] < DATE ( YEAR ( TODAY () ), 10, 1 )
&& [Date] >= DATE ( YEAR ( TODAY () ), 3, 1 )
)
|| (
[Date] >= DATE ( YEAR ( TODAY () ), 12, 1 )
&& [Date] <= DATE ( YEAR ( TODAY () ), 12, 31 )
)
|| (
[Date]
>= DATE ( YEAR ( TODAY () ) - 1, 6, 1 )
&& [Date]
<= DATE ( YEAR ( TODAY () ) - 1, 6, 30 )
)
|| (
[Date]
>= DATE ( YEAR ( TODAY () ) - 1, 12, 1 )
&& [Date]
<= DATE ( YEAR ( TODAY () ) - 1, 12, 31 )
)
)
)
),
SUM ( 'Table'[Value] )
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Madhura29 , You need to create the bar visual on an independent date table. based on that you can have more dates on the other selected visual
explained similar stuff here - Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
User | Count |
---|---|
124 | |
108 | |
99 | |
62 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |