Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi i am going to create a new table in which show the two column from the below attached image
result:
In result it shows the count of prod_id against those column based on check.
like count of prod_id where bath column is bath and count of prod_id where shower column is shower and count of prod_id where large and small is true.
|
Please help me with it i want to do this through dax
Solved! Go to Solution.
Hi, @hammadafridi
You can try the following methods.
Table2 =
UNION (
SUMMARIZE (
'Table',
"type", "shower",
"count", COUNTAX ( FILTER ( 'Table', [shower] = "shower" ), [shower] )
),
SUMMARIZE (
'Table',
"type", "bath",
"count", COUNTAX ( FILTER ( 'Table', [bath] = "bath" ), [bath] )
),
SUMMARIZE (
'Table',
"type", "large",
"count", COUNTAX ( FILTER ( 'Table', [large] = TRUE ), [large] )
),
SUMMARIZE (
'Table',
"type", "small",
"count", COUNTAX ( FILTER ( 'Table', [small] = TRUE ), [small] )
)
)
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @hammadafridi
You can try the following methods.
Table2 =
UNION (
SUMMARIZE (
'Table',
"type", "shower",
"count", COUNTAX ( FILTER ( 'Table', [shower] = "shower" ), [shower] )
),
SUMMARIZE (
'Table',
"type", "bath",
"count", COUNTAX ( FILTER ( 'Table', [bath] = "bath" ), [bath] )
),
SUMMARIZE (
'Table',
"type", "large",
"count", COUNTAX ( FILTER ( 'Table', [large] = TRUE ), [large] )
),
SUMMARIZE (
'Table',
"type", "small",
"count", COUNTAX ( FILTER ( 'Table', [small] = TRUE ), [small] )
)
)
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@hammadafridi , In power query, Unpivot and group by
https://radacad.com/pivot-and-unpivot-with-power-bi
in Dax
Union and summarize
union(
summarize(Table, "Count" , count(Table[Bath]) ,"Column", "Bath" ) ,
summarize(Table, "Count" , count(Table[Shower]) ,"Column", "Shower" ) ,
summarize(Table, "Count" , count(Table[large]) ,"Column", "large" ) ,
summarize(Table, "Count" , count(Table[small]) ,"Column", "small" )
)
You can use distinct count if needed
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |