Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
manojk_pbi
Helper IV
Helper IV

help required to write Measure

Hi 

 

I am writing a meaure to calculate %Change from Dec'23 to Mar'24 and display value on card. Using the below measure.

Along with this KPI, i have few more KPIs on the same report which will use the filter of the ReportingMonth. 

 

I want below expression should not filter based on selected reporting month and do the calculation just by using reporting month value and defined values from preMY.

 

%Change_CYCM =
VAR _preMY = VALUE("2023-12-01")
VAR _preqty =
CALCULATE (
SUM ( 'Bugs'[BUGS_COUNT] ), FILTER(ALLSELECTED('Bugs'),
'Bugs'[ReportMonth]=_preMY)
)
VAR _curMY = VALUE("2024-03-01")

VAR _curqty =
CALCULATE (
SUM ( 'Bugs'[BUGS_COUNT] ),
FILTER (
ALLSELECTED ( 'Bugs' ),

'Bugs'[ReportMonth] = _curMY
)
)
RETURN

DIVIDE ( _preqty-_curqty, _preqty )

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Instead of 

 

VAR _preMY = VALUE("2023-12-01")

 

use

 

VAR _preMY = dt"2023-12-01"

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Instead of 

 

VAR _preMY = VALUE("2023-12-01")

 

use

 

VAR _preMY = dt"2023-12-01"

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.