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
Erwin
Helper II
Helper II

DAX formula not adhering to time selection

Hi all,

 

I have an interesting question about a DAX formula that does not respond correctly when time is restricted. Please review attached picture of my report.

 

Amount of Last Invoice Sent not calculated when time is restriced.PNG

 

What I want the measure "Amount of Last Invoice Sent" to do is to show the amount of the latest invoice on the Total line. So that when the user expands all projects he will see the amount of the invoice that was sent last for each project.

 

This works great when time is not restricted in any way. As you can see in the top table the value of the invoice with the most current baseline date (last row) is also shown as Total. However, when I restrict time to somewhere in the past (e.g. 31-7-2017) the measure doesn't give me a value anymore (see lower table).

 

Can anybody tell me why this is and how to get around this?

 

Many thanks in advance.

Erwin

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Erwin,

 

Try to change your measure to:

 

AMOUNT last invoice =
VAR Last_Date =
    MAX ( TTCFactTable[Baseline Date] )
RETURN
    CALCULATE (
        [AMOUNT of Invoices Sent];
        TTCFactTable[Baseline Date] = Last_Date;
        ALLSELECTED ( TTCFactTable[Baseline Date] )
    )

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Erwin,

 

Try to change your measure to:

 

AMOUNT last invoice =
VAR Last_Date =
    MAX ( TTCFactTable[Baseline Date] )
RETURN
    CALCULATE (
        [AMOUNT of Invoices Sent];
        TTCFactTable[Baseline Date] = Last_Date;
        ALLSELECTED ( TTCFactTable[Baseline Date] )
    )

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.