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 I need a solution to find the previous days count. Where if i click today's date it should show the Yesterday's result.
As an sample i have attached a screenshot here.
Kindly help with your ideas thank you.
Solved! Go to Solution.
Hi,
I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.
Selected day count measure: =
COUNTROWS( Data )
Previous day count measure: =
CALCULATE ( [Selected day count measure:], Data[Date] = MAX ( Data[Date] ) - 1 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.
Selected day count measure: =
COUNTROWS( Data )
Previous day count measure: =
CALCULATE ( [Selected day count measure:], Data[Date] = MAX ( Data[Date] ) - 1 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you so much JIHWAN_Kim
hah, your solution looks simpler and faster than mine Jihwan. 😄
My only comment is I do still prefer SELECTEDVALUE to MAX because the measure only makes sense if exactly one date is selected.
Hello!
Try the below measure out and let me know whether it works for you or not. 😄
Yesterday Count =
VAR Yesterday = SELECTEDVALUE ( Table1[Date] ) - 1
-- Filters your data for yesterday's row
VAR FilteredTable =
FILTER (
ALL ( Table1 ),
Table1[Date] = Yesterday
)
RETURN
SUMX (
FilteredTable,
Table1[Count]
)
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 |
---|---|
51 | |
27 | |
24 | |
13 | |
9 |
User | Count |
---|---|
74 | |
56 | |
47 | |
16 | |
12 |