I am working on report ,where i need to take the amount based on latest datetime.
For this i created a measure
@khush19 Betting there is probably a reason. Unfortunately, not really enough information to go on. What exactly are you trying to accomplish with that measure because it seems like it could just be:
Please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
I have data like :
now i need to get Amount based on max (currenttime).
For this i created a measure and this measure is used in many measure to calculate difference ,% change.
and the worst part is it,this measure works sometimes and sometimes not.
and it work in SIT,UAT and fail only in PROD 😞
@khush19 First, not typing that data into an Enter Data query to mock this up, please post as text.
Second, what do you mean by the MAX of currenttime? If you have a measure and you put it in a visual along with currenttime column then if you get the MAX of the currenttime, you are getting that row's currenttime, which is already in context so you don't need to filter on it because that row in the table visualization and already filtered to that currenttime which is why your formula seems like it is equivalent to SUM([totalamount])
In other words, if I had data like:
And I create a measure like:
Measure = MAX([Color])
This would return the exact same thing as:
Measure = CALCULATE(MAX([Color]),FILTER('Table',[Color]=MAX([Color])))
So, should your measure work? Yes, but it is unnecessarily complicated.
I am using Card,to investigate the issue i created table.
and seems like for some rows even i compare int column in max ,then also it doesnt return desired result
You might consider providing your dummy pbix that would be helpful for us to investigate it further.
You can upload it to the onedrive for business and share the link here. please don't forget to disclose the expected results and remove the confidential info.
@khush19 , You expected output is not clear. Max on the row context as good as row values unless there is some logic added
Total Calculated Amount =
var _max =MAXX(ParkingSessionSA,ParkingSessionSA[CurrentTime])
Can you share sample data and sample output in a table format? Or a sample pbix after removing sensitive data.
@khush19 OK, has to be an issue with your data then. Is this import mode or Direct Query mode or?
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.