Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
newbie_powerbi
Helper II
Helper II

sumx and allselected

https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/ 

 

I can see that iteration on allselected creates a shadow context

I use ALLSELECTED inside SUMX 

so how can I handle my problem

I need the unique count of person whose tickets are open

which means I need to consider only 1 ticket for person when I have 2 open tickets

ticket which needs to be considered as latest open ticket (max of open_dt)

 

image.PNGimage2.PNG

 

 

this is my dax for finding the unique count 

which results in total in table as correct but the values are still the same as my open ticket count measure

 

 

attaching my example file

https://drive.google.com/file/d/1G_sfyGqbAyCbxA359lShcC6z06zDWYIA/view?usp=share_link 

11 REPLIES 11
andhiii079845
Solution Sage
Solution Sage

Thank you for directly sharing the PBI. This make it so easy for helping! 
Do not forget to mark my solution, thank you 🙂
Try this
Measure 2 =
MAXX(FILTER('Table','Table'[close_dt]=BLANK()),'Table'[open_dt])

Measure 3 =
COUNTX(FILTER('Table','Table'[close_dt]=BLANK()),'Table'[open_dt])
andhiii079845_1-1678028100881.png

 

 andhiii079845_0-1678028057130.png




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@andhiii079845 

sure, you have incorporated the logic of open inside the measure but my logic has mutiple conditions for open & my table has 10 millions rows

 

I just added a simple logic for the understanding

I need the same results using open ticket count measure

 

thank you

Than change it like this:

Measure 2 =
MAXX(FILTER('Table','Table'[open ticket count]=1),'Table'[open_dt])
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ss

placed the measure but it is returning the same value as open_dt

friend_measure.PNG

friend_measure3.PNG

You mentionied this, what you want zu see (yellow):

andhiii079845_0-1678171147995.png

 

I send you this: (measure definition in my previous post)

andhiii079845_1-1678171165255.png

 

You build this: 

andhiii079845_2-1678171180793.png

Delete the columns open_dt and close_dt in your matrix. 🙂
Than you get the yellow marked rows. If you want something else please make a little example in excel what do you want to see excatly. 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




You can not but open_dt and close_dt in this matrix. look to my matrix.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




can you share the pbix file

I replaced the same measure as you sent but got the max date as open_dt

Make a matrix in excel and show us what you want to see 1:1 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




andhiii079845
Solution Sage
Solution Sage

Your open_dt and close_dt columns are the reason for the current matrix. can you please share exactly how the matrix should look like?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




image3.PNG

 

out of these 9 rows I only need to see the highlighted 2 rows 

i.e. distinct count of a person who has latest open ticket 

thanks for helpin me out @andhiii079845 

I don't know how it is affecting but

I have attached the link for the sample file 

 

I need to show the table for distinct count of person whose tickets are open

i.e. only 1 row should be considered for a person (if 2 open tickets are there for same person then max open_dt row should be considered) image3.PNG

I should show only the highlighted rows & my count should be 2

https://drive.google.com/file/d/1G_sfyGqbAyCbxA359lShcC6z06zDWYIA/view?usp=share_link 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.