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

Want to take Max Values by Category that changes according to Date Sclicer

I have a data source, where I need the maximum date's value by grouping according to a category. The problem is, the dataset changes according to a date slicer being applie. Is it possible to achieve it?

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@aarshps

 

Try something on this pattern

 

Measure =
CALCULATE (
    MAX ( TableName[Date] ),
    ALLEXCEPT ( TableName, TableName[Category] )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@aarshps

 

Try something on this pattern

 

Measure =
CALCULATE (
    MAX ( TableName[Date] ),
    ALLEXCEPT ( TableName, TableName[Category] )
)

Regards
Zubair

Please try my custom visuals

Yeah, it does work.

I tried using the measure as you suggested, but it didn't work.

 

I'll explain the problem in detail. What I need is as shown below.

 

Rejected Amount

 

The above image show the data result when I apply 2 different date filters. First filter I apply is DateKey BETWEEN 20180301 AND 20180307, second one is BETWEEN 20180301 AND 20180306. In the second fitler, last status is Rejected, but in the first filter, Closed is the last one.

 

The measure that I need to create is SUM(Amount). But this Amount column above is something that I've written using SQL. So, the logic here is, when the latest Status is Rejected, then I need to calculate the Amount, it is simple. But I'm not able to write a DAX for this measure.

Hi @aarshps,

 

Can you please provide some sample data to test?

 

Regards,

XIaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.