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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
givenmnisi6
New Member

Power Query -

Capture.PNGhow can make a measure that counts the number of devices installed each year? 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @givenmnisi6,

These expressin should be used in measure formulas instead of calculated column, or they will be fixed the calculation result to static numbers. (measure are calculated based on filter and row context)

Calculated Columns and Measures in DAX - SQLBI

Row Context and Filter Context in DAX - SQLBI

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
dcrosseto
Resolver II
Resolver II

Hi @givenmnisi6 ,

 

You can just use a simple COUNT or DISTINCTCOUNT (if IDs repeats), the way you will "aggregate" depends on how you create the visualizations. You can create a single measure that counts the devices and work on the dimensions around it, this will determine how the count will works.

 

Count All = DISTINCTCOUNT(Data[id])

 

 

But of course, you can also specify the aggregation using GROUP BY,

 

Count by Year = 

CALCULATE(
    DISTINCTCOUNT(Data[id]),
    GROUPBY(Data,Data[year])
)

 

 

But if's not gonna change much, what really impacts the results are the viz or dimensions around it, check example below with both measures.

4.png

Hope it was helpful!! Also, if solved your problem, please mark as solution to help other as well.

 

Regards,

Douglas.

 

 

I tried using both of them, ill show you the output.

Capture.PNGCapture2.PNG

Anonymous
Not applicable

Hi @givenmnisi6,

These expressin should be used in measure formulas instead of calculated column, or they will be fixed the calculation result to static numbers. (measure are calculated based on filter and row context)

Calculated Columns and Measures in DAX - SQLBI

Row Context and Filter Context in DAX - SQLBI

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.