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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Help With Formula to get default values

Initial Screen.PNGScreenshot2.PNGScreenshot2.PNG

Hi,

I have a case I have to display the sum of values in a card for feb month by default and not for the other months.

As shown in the Screenshot Initial Screen the cards JDE and Myfinance are showing a sum of values for months feb,jan and dec.

But What I want is to show the Cards with values of Feb month keeping rest of the months bar intact, so basically what I want is the screeenshot1 and screenshot2 combined as a single report so that by default i can display the feb month data.

 

I have already written a Conditional column for getting the Feb month and rest of the months.

Feb = IF(YEAR('ERP KPI_Data'[MetricDate]) = YEAR(Today()),IF(MONTH('ERP KPI_Data'[MetricDate])=month(TODAY()-40),1,0),0)

Feb month = if('ERP KPI_Data'[CMisCurrentMonth]=1,'ERP KPI_Data'[Value],0)

prevmonth = if('ERP KPI_Data'[CMisCurrentMonth]=0,'ERP KPI_Data'[Value],0)

Filter = switch('ERP KPI_Data'[CMisCurrentMonth],0,'ERP KPI_Data'[prevmonth],'ERP KPI_Data'[Feb month]) 

 

and tried to use this in a switch case to show a default record, but it's giving the result as I expected

  

 

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

According to your description above, I would suggest you use the formula below to create a measure to calculate the Value for Feb which won't be change by other user interactions on the report.Smiley Happy

JDE Feb measure =
CALCULATE (
    SUM ( 'ERP KPI_Data'[Value] ),
    FILTER (
        ALL ( 'ERP KPI_Data' ),
        YEAR ( 'ERP KPI_Data'[MetricDate] ) = YEAR ( TODAY () )
            && MONTH ( 'ERP KPI_Data'[MetricDate] )
                = MONTH ( TODAY () - 40 )
            && 'ERP KPI_Data'[Source] = "JDE"
    )
)
My Finance Feb measure =
CALCULATE (
    SUM ( 'ERP KPI_Data'[Value] ),
    FILTER (
        ALL ( 'ERP KPI_Data' ),
        YEAR ( 'ERP KPI_Data'[MetricDate] ) = YEAR ( TODAY () )
            && MONTH ( 'ERP KPI_Data'[MetricDate] )
                = MONTH ( TODAY () - 40 )
            && 'ERP KPI_Data'[Source] = "myFinance"
    )
)

 

Regards

Anonymous
Not applicable

Hi v-ljerr-msft,

Thanks for your reply. But I am getting a higher value, also I want the JDE and MYfinance to show the feb month data by default,but on User intactions the values should changes according to previous month also.Screenshot3.PNG

 

Thanks

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.