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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jvandyck
Helper IV
Helper IV

Dax question

Hi 

 

I have a data table with region, date, bank balance and advance payment.

I have to compare the bank balance against a target. The target is the full year sum of the advance payments of the previous year, divided by 12 by 100.

This is the formula: 

Target month bank balance = calculate(SUM('Monthly Surplus'[Advance Payment]), previousyear('Date'[Date]))/12/100
 
I want to create a table showing year and the number of times the bank balance exceeded the target. I have tried this formula, but it does not seem to work:
Exceeded summarize = COUNTAX
(
SUMMARIZE('Monthly Surplus','Date'[Year],'Date'[Month],'Monthly Surplus'[Regio],"Bank Balance",sum('Monthly Surplus'[Bank Balance]),"target",calculate([Target month bank balance])),if(not isblank([Bank Balance]),[Bank Balance]>[target]))
 
In this last formula, it seems that the target is nog calculating and therefore counting every month.
1 REPLY 1
amitchandak
Super User
Super User

@jvandyck , You can create a table

= row("Date", date(year(today()),1,1), "Target",calculate(SUM('Monthly Surplus'[Advance Payment]), previousyear('Date'[Date]))/12/100)

 

You can now use blog to deal with yearly target

 

#PowerBI Distributing/Allocating the Yearly Target(Convert to Daily Target): Measure ( Daily/YTD): Magic of CLOSINGBALANCEYEAR With TOTALYTD/DATESYTD: https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Yearly-Target-C...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.