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
hariepermana
Frequent Visitor

set target goals value always show lastday of the month

Hello expert,

 

i've a data (sales amount) on my database and i update it everyday.

i make a kpi card and i wanna compare every sales amount (everyday) with monthly target. the problem is, i've date measure on my page and everytime i drag it day by day, it wont compare with monthly target (show blank) except i drag it on a last day of the month.

 

can you help me, which kind of DAX can solve my problem.

and here my sample data

1. Table Sales

    date | amount_sales

    2020-10-01 | 100

    2020-10-02 | 200
    2020-10-03 | 300
2. Table target_goals
    date | amount_target

    2020-10-31 | 2000
3. Table master_calendar

and here my latest DAX (target goals)

target_amount = VAR latestDate = MAX('master_calendar'[date]) RETURN CALCULATE(SUM('target_goals'[amount_target]),'target_goals'[date]=latestDate)


i appreciate every help
thank you

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@hariepermana , For target you can use closingbalancemonth and date table. As that is saved on last date.

 

That has been discussed in details in my video :https://youtu.be/yPQ9UV37LOU

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@hariepermana , For target you can use closingbalancemonth and date table. As that is saved on last date.

 

That has been discussed in details in my video :https://youtu.be/yPQ9UV37LOU

@amitchandak , thank for your suggestion, it 100% work!

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.

Top Solution Authors