Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
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
I am trying to write a measure that counts the number of [Id] where [Total] is the same for the two [Datatype]s, method1 and method2.
The count for the data above should be 5.
Thanks!
Erez
Solved! Go to Solution.
Here is a MEASURE
Measure =
COUNTX (
FILTER (
VALUES ( Table1[ID] ),
CALCULATE ( SUM ( Table1[Total] ), Table1[Data Type] = "Method1" )
= CALCULATE ( SUM ( Table1[Total] ), Table1[Data Type] = "Method2" )
),
1
)
Hi,
Will there only be 2 data types or can there be more as well?
Only 2 data types
Well, one way to do this would be to use a calculated column like this:
SameTotal = COUNTX(FILTER(Table,Table[Id]=EARLIER(Table[Id]) && Table[DataType]<>EARLIER(Table[DataType]) && Table[Total]=EARLIER(Table[Total])),[Total])
Then you could create a measure that just SUM'd SameTotal or did a COUNT of SameTotal and divided the result of that by the number of methods.
Here is a MEASURE
Measure =
COUNTX (
FILTER (
VALUES ( Table1[ID] ),
CALCULATE ( SUM ( Table1[Total] ), Table1[Data Type] = "Method1" )
= CALCULATE ( SUM ( Table1[Total] ), Table1[Data Type] = "Method2" )
),
1
)
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 |
|---|---|
| 50 | |
| 44 | |
| 41 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 32 | |
| 32 | |
| 32 |