Forum Discussion
Tretas : Not getting count based on variable
Hello Team,
am trying to get count of priority am using below code but it is not working.
Great!
Please accept the solution(s) that resolved your question in order to mark it as accepted so future readers can find it more quickly.
9 Replies
- Chandrashekar
Resolver III
Hello Team,
Please see attached example report Sample Report as am trying to get priority count am using below code but it is not working.
- DimaMD
Solution Sage
Hi, Is this your desired result?
- Chandrashekar
Resolver III
Hello,
I need to Priority1 and Pririty 2 in two different columns.
Regards,
Chandrashekar B
- smpa01
Community Champion
Chandrashekar I am guessing you are expecting this
To reach the following outcome, you need two measures
_countrows = VAR _name = MAX ( Table3[Name] ) VAR _location = MAX ( Table3[Location] ) VAR _tbl = CROSSJOIN ( SELECTCOLUMNS ( { _name }, "name", [Value] ), SELECTCOLUMNS ( { _location }, "location", [Value] ) ) RETURN CALCULATE ( COUNTROWS ( FILTER ( Table1, Table1[Priority] = 1 ) ), TREATAS ( _tbl, Table1[Name], Table1[Location] ) ) Sum = SUMX(Table3,[_countrows])- Chandrashekar
Resolver III
Hello,
I need to Priority1 and Pririty 2 in two different columns.
Regards,
Chandrashekar B
- AlexisOlson
Super User
The cross join construction feels odd to me.
I think I'd try writing this DAX more like this:
Inflow_Priority = CALCULATE ( COUNTROWS ( Source ), FILTER ( ALL ( Source ), Source[Priority_is] = 1 ), TREATAS ( SUMMARIZE ( CompanyRegionAU, CompanyRegionAU[Company], CompanyRegionAU[Region] ), Source[company], Source[Region] ), TREATAS ( VALUES ( Queue[Queue] ), Source[Queue] ) )- Chandrashekar
Resolver III
Hello Alex,
I tried your solution but it is not working. I need Priority 1 and Priority 2 in different columns.
Regards,
Chandrashekar B
- Chandrashekar
Resolver III
Hello Alex,
Sorry it is my mistake(Format issue it was text and turned to Number) and it is working now.