The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
new to powe bi, i need to compare last year month count to presene year count, if value increase need to show arrow mark should be up, if decrease arrow should be down in conditional formate
when i use date date add, parallell period, privious month it will compare with in the year of month it won't give result last year month screen shot below
pls help me sort out this issue
Solved! Go to Solution.
Hi @Anonymous ,
Use a single slicer and create two measures like below:
current_year_month =
CALCULATE (
COUNT ( 'table'[value] ),
FILTER (
ALLSELECTED ( 'table' ),
'table'[plant] = SELECTEDVALUE ( 'table'[plant] )
&& YEAR ( 'table'[date] ) = YEAR ( SELECTEDVALUE ( 'table'[date] ) )
&& MONTH ( 'table'[date] ) = MONTH ( SELECTEDVALUE ( 'table'[date] ) )
)
)
Last_year_month =
CALCULATE (
COUNT ( 'table'[value] ),
FILTER (
ALLSELECTED ( 'table' ),
'table'[plant] = SELECTEDVALUE ( 'table'[plant] )
&& YEAR ( 'table'[date] )
= YEAR ( SELECTEDVALUE ( 'table'[date] ) ) - 1
&& MONTH ( 'table'[date] ) = MONTH ( SELECTEDVALUE ( 'table'[date] ) )
)
)
Best Regards,
Jay
Hi @Anonymous ,
Use a single slicer and create two measures like below:
current_year_month =
CALCULATE (
COUNT ( 'table'[value] ),
FILTER (
ALLSELECTED ( 'table' ),
'table'[plant] = SELECTEDVALUE ( 'table'[plant] )
&& YEAR ( 'table'[date] ) = YEAR ( SELECTEDVALUE ( 'table'[date] ) )
&& MONTH ( 'table'[date] ) = MONTH ( SELECTEDVALUE ( 'table'[date] ) )
)
)
Last_year_month =
CALCULATE (
COUNT ( 'table'[value] ),
FILTER (
ALLSELECTED ( 'table' ),
'table'[plant] = SELECTEDVALUE ( 'table'[plant] )
&& YEAR ( 'table'[date] )
= YEAR ( SELECTEDVALUE ( 'table'[date] ) ) - 1
&& MONTH ( 'table'[date] ) = MONTH ( SELECTEDVALUE ( 'table'[date] ) )
)
)
Best Regards,
Jay
Hi @Anonymous
try with two slicers, one for the year and one for the month and avoid using hierarchy slicer
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |