Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
how can make a measure that counts the number of devices installed each year?
Solved! Go to Solution.
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
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.
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.
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 23 |