Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Team,
In attached file Sample Report I have two measures. is it possible to combine Measure 2 with Measure 1.
Regards,
Chandrashekar B
Solved! Go to Solution.
Try putting your variables inside the SUMX.
_countrows =
SUMX (
SUMMARIZE ( Table3, Table3[Name], Table3[Location] ),
VAR _tbl =
CROSSJOIN (
SELECTCOLUMNS ( { Table3[Name] }, "name", [Value] ),
SELECTCOLUMNS ( { Table3[Location] }, "location", [Value] )
)
RETURN
CALCULATE (
COUNTROWS ( FILTER ( Table1, Table1[Priority] = 1 ) ),
TREATAS ( _tbl, Table1[Name], Table1[Location] )
)
)
How about this?
Combined =
SUMX (
SUMMARIZE ( Table3, Table3[Name], Table3[Location] ),
CALCULATE (
COUNTROWS ( FILTER ( Table1, Table1[Priority] = 1 ) ),
Table1[Name] = EARLIER ( Table3[Name] ),
Table1[Location] = EARLIER ( Table3[Location] )
)
)
Hello Alex,
It is working fine but not working if i use Treatas. Any advise on it.
_countrows =
VAR _name =
MAX ( Table3[Name] )
VAR _location =
MAX ( Table3[Location] )
VAR _tbl =
CROSSJOIN (
SELECTCOLUMNS ( { _name }, "name", [Value] ),
SELECTCOLUMNS ( { _location }, "location", [Value] )
)
RETURN
SUMX(
SUMMARIZE(Table3,Table3[Name],Table3[Location]),
CALCULATE (
COUNTROWS ( FILTER ( Table1, Table1[Priority] = 1 ) ),
TREATAS ( _tbl, Table1[Name], Table1[Location] )
))
Regards,
Chandrashekar B
Try putting your variables inside the SUMX.
_countrows =
SUMX (
SUMMARIZE ( Table3, Table3[Name], Table3[Location] ),
VAR _tbl =
CROSSJOIN (
SELECTCOLUMNS ( { Table3[Name] }, "name", [Value] ),
SELECTCOLUMNS ( { Table3[Location] }, "location", [Value] )
)
RETURN
CALCULATE (
COUNTROWS ( FILTER ( Table1, Table1[Priority] = 1 ) ),
TREATAS ( _tbl, Table1[Name], Table1[Location] )
)
)
Hello Alex,
Thanks it is working fine.
Regards,
Chandrashekar B
Hello Alex,
Thank you and will try on it.
Regards,
Chandrashekar B
@Chandrashekar , I tried a few combinations. Current two measure solution seems better
I tried this and it did not work
_countrows =
VAR _name =
MAX ( Table3[Name] )
VAR _location =
MAX ( Table3[Location] )
VAR _tbl =
CROSSJOIN (
SELECTCOLUMNS ( { _name }, "name", [Value] ),
SELECTCOLUMNS ( { _location }, "location", [Value] )
)
var _final = CALCULATE (
COUNTROWS ( FILTER ( Table1, Table1[Priority] = 1 ) ),
TREATAS ( _tbl, Table1[Name], Table1[Location] )
)
RETURN sumx(ADDCOLUMNS(summarize(Table3,Table3[Name],Table3[Location]),"_1",calculate(_final)),[_1])
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |