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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply

Dax - Measure calculation for country visit count

Hi,

Could you please help me with the measure calculation for the below scenario,

I have a table like shown below which has the 'Name' and the number of times each person has visited a country:

 Number of visits
NameChinaUSUKGermany
Roy3000
Joe2030
Marie1501
Vish0111
Wayne5000


I need to find the number of people who only visited China and not other countries.

In this case, it has to be '2' because only Roy and Wayne have visited China but not other countries.

Any help on this is appreciated.


Thanks a lot.

4 REPLIES 4

Its actually an output from a excel pivot that was shared in a normal excel which i am using as a source.

@Anonymous_mdky 
You may keep it pivotted if you have samll number of columns which I doubt with your real data. In case of large number of columns it is advised to unpivote the table using power query. That would also keep the door open for dynamic solution without having to add a new disconnected table. Three possible solutions as follows:

1.png

ThxAlot
Super User
Super User

visit.pbix

 

ThxAlot_0-1696482760215.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



tamerj1
Super User
Super User

Hi @Anonymous_mdky 

is this s source table or a matrix visual?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.