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.
hi all, i am new to power bi and looking for some help.
I have a table where i have entered data based on every date.
I want to show data only for my last row.
Lets Say i just want to show value of steps i have taken on 9 March 2020. For me it sums up value when i use card to display steps on dashboard
Date | Running | Steps | Calories Burn |
8 March 2020 | 3000 | 7000 | 200 |
9 March 2020 | 2700 | 6500 | 180 |
Solved! Go to Solution.
Hi, @nmehra2205
Based on your description, I created data to reproduce your scenario.
You may create a measure as follows.
LastestSteps =
LOOKUPVALUE(
'Table'[Steps],
'Table'[Date],
CALCULATE(
MAX('Table'[Date]),
ALLSELECTED('Table')
)
)
Result:
Then I add a new row.
Here is the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @nmehra2205
If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.
Best Regards
Allan
Hi, @nmehra2205
Based on your description, I created data to reproduce your scenario.
You may create a measure as follows.
LastestSteps =
LOOKUPVALUE(
'Table'[Steps],
'Table'[Date],
CALCULATE(
MAX('Table'[Date]),
ALLSELECTED('Table')
)
)
Result:
Then I add a new row.
Here is the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
While solutions from @Greg_Deckler and @Ashish_Mathur should work for you. Also, try if lastnonblankvalue can fit in you case
https://docs.microsoft.com/en-us/dax/lastnonblankvalue-function-dax
lastnonblankvalue(Table[date],sum(table[Steps]))
This came in the latest release only. So you should be on the latest version.
Hi,
Try these measures
Steps taken = SUM(Data[Steps])
Steps taken on last date = CALCULATE([Steps taken],LASTDATE(Data[Date]))
Hope this helps.
So in generaly you do that like the following:
Is Max Measure =
VAR __Date = MAX('Table'[Date])
VAR __Max = MAXX(ALL('Table'),[Date])
RETURN
IF(__Date = __Max,TRUE(),FALSE())
Then you can use this in your Filter pane to filter just for Is Max Measure equals True.
Thank you for reply.But I am still not able to get the value of last coulmn.
I need specefic value ie: number of steps today (no sum, mo median, no average)
First the bad news. if you are going to use a measure, you have to use some form of aggregation.
Now the good news, if you filter down to a single row and use any aggregation, you have the number.
I made a minor adjustment to make the measure more filter friendly:
Is Max Measure =
VAR __Date = MAX('Table'[Date])
VAR __Max = MAXX(ALL('Table'),[Date])
RETURN
IF(__Date = __Max,1,0)
I also wrote you this one that demonstrates how to extract a particular value:
My Steps =
VAR __Table =
ADDCOLUMNS(
'Table',
"__IsMaxMeasure",[Is Max Measure]
)
RETURN
MAXX(
FILTER(
__Table,
[__IsMaxMeasure] = 1
),
[Steps]
)
And I attached the PBIX.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
107 | |
88 | |
76 | |
67 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |