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.
Hello,
I can't get my head around as to why the dax measure below (Number 1) doesn't work the way i want. I thought both 1 and 2 measures should behave the same way but not. Can someone explain me why the first dax measure doesn't filter to show only the last day records?
Solved! Go to Solution.
Hi @Anonymous
Please try my measure:
test3 =
VAR _MaxDate = MAXX(ALL('Table'),'Table'[Gaming Date])
RETURN
CALCULATE(COUNT('Table'[Gaming Date]),FILTER('Table','Table'[Gaming Date]=_MaxDate))
My Sample:
Result is as below. Test1 and test2 are measures like yours, you see test3 will get the correct result dynamiclly instead of use "Date" fucntion.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Please try my measure:
test3 =
VAR _MaxDate = MAXX(ALL('Table'),'Table'[Gaming Date])
RETURN
CALCULATE(COUNT('Table'[Gaming Date]),FILTER('Table','Table'[Gaming Date]=_MaxDate))
My Sample:
Result is as below. Test1 and test2 are measures like yours, you see test3 will get the correct result dynamiclly instead of use "Date" fucntion.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-rzhou-msft
That is exactly what I am after . you are a legend :).
Decided not to waste my time replying until I get a proper solution as I have given enough information. Really happy that it crossed you.
Thanks again.
Cheers,
Deevs
@Anonymous just asked a simple question, Read this post to get your answer quickly. It helps everyone.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous what you want to achieve? You just asked why measure 1 is different than measure 2 but you never explained what you are looking for. @pranit828 gave an explanation of the difference between measure 1 and measure 2.
In nutshell, @pranit828 answered your original question but if you need a further solution, you should tell what you are looking for.
Well done @pranit828
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Calm Down you might end up with high blood pressure lol.
@pranit828
I want to count the records but based on a specific time period, say based on the max day or min day of the table.. If I drag the date into a table along with the measure I should only get the values based on the time period applied within the dax measure. Hope that makes sense.
How do you modify the below measure to achivew that. I want the table to only show the last day, not all.
Hi @Anonymous
I agree with @parry2k and really hope that you use his link on how to get answers quickly.
Your initial ask and the purpose of this post is fulfilled with my first reply.
To keep the sanity of the post you already have your answer. This is going to be a new post my friend.
You should appreciate people trying to help here investing our personal time we can be doing something else helping other get through with work task. which demands only one thing.
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
lol "myfrind" "Your initial ask and the purpose of this post is fulfilled with my first reply."
Hi @Anonymous
To reply to your question about why measure1 doesn't work and measure2 works is
Measure1 is still working on each row for max function and it sees the data in current row as max.
Now to make it work you need to let the whole calculation know that it needs to work on the entire selected table and that is what ALLSELECTED does.
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
Hi @Anonymous
Remove filter funcion from your measure
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
@Anonymous , In the filter one,
You have to use as the example
calculate([measure], filter(allselected(Table), [Date] =max([Date]))
allselected is important
@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |