Forum Discussion
Calculated column do not respect page filter
Hi all.
I have some data like this:
| id | Date | Dim1 |
| id1 | 01.01.2020 | A |
| id2 | 01.02.2020 | A |
| id3 | 01.02.2020 | A |
| id4 | 01.02.2020 | B |
I want to show on report how many lines we have on given date (incling all previous dates)
I created a calculated column:
In your case, you have created a column where count of max is precalculated. so it will not work. This need to create as a measure, such measure need all to be used to you have to have a dimension table
Refer solution: https://www.dropbox.com/s/nbqn94k2fw2oaow/maxcount.pbix?dl=0
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin
3 Replies
- hnguy71Super User
- amitchandakSuper User
In your case, you have created a column where count of max is precalculated. so it will not work. This need to create as a measure, such measure need all to be used to you have to have a dimension table
Refer solution: https://www.dropbox.com/s/nbqn94k2fw2oaow/maxcount.pbix?dl=0
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin- leokMicrosoft Employee
That you very much, amitchandak.
I was even able to simplify your solution to not require additional table:
CountOnDate2 = CALCULATE(DISTINCTCOUNT(Sheet1[id]);FILTER(ALL(Sheet1[Date]);Sheet1[Date]<=max(Sheet1[Date]) ))However, my solution not works if I replace Date with Date hierarchy - in that case it gives same as count(id), while your solution works in both cases.