Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello everyone ,
I have to display in pie chart the Number of hosts per number of conference bracket,
Fot that i do not have a legend and measure ,
legend should be displayed as this way ;
if count(conf id ) per host <4 ==>0-4 meetings
if count(conf id) per host between 4 and 10 ==> 4-10meetings
if count(confid) per host >10==> >10meetings
so in the legend i shouad have 3 items : 0-4 meetings 4-10meetings 10meetings
and in the value of my pie chart i shuld have the number of host per number of the conference brackets
How can i do this please , i don't know how to create my legend
Solved! Go to Solution.
Hi @Anonymous
Try to add a new column to your table with this code:
Count ID per Host =
VAR _Confid =
FIRSTNONBLANK ( 'Table'[confid], "" )
VAR _Host =
FIRSTNONBLANK ( 'Table'[Hostid], "" )
VAR _Count =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( ALL ( 'Table' ), 'Table'[Hostid] = _host && 'Table'[confid] = _Confid )
)
RETURN
SWITCH (
TRUE (),
_Count < 4, "0-4 meetings",
_Count > 4
|| _Count < 10, "4-10 meetings",
_Count > 10, "10 meetings"
)
Then use that new column in your pie chart as a legend:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
In a Pie chart, I used the Hostid column and changed the aggregation to count.
Appreciate your Kudos!!
Hi @Anonymous
Can you share a sample of your data in a table format here:
Appreciate your Kudos✌️!!
Hostid | confid |
shinigalo@gmail.com | 122333 |
sivkya.loli@gmail.com | 122699 |
shinigalo@gmail.com | 123666 |
Hi @Anonymous
Try to add a new column to your table with this code:
Count ID per Host =
VAR _Confid =
FIRSTNONBLANK ( 'Table'[confid], "" )
VAR _Host =
FIRSTNONBLANK ( 'Table'[Hostid], "" )
VAR _Count =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( ALL ( 'Table' ), 'Table'[Hostid] = _host && 'Table'[confid] = _Confid )
)
RETURN
SWITCH (
TRUE (),
_Count < 4, "0-4 meetings",
_Count > 4
|| _Count < 10, "4-10 meetings",
_Count > 10, "10 meetings"
)
Then use that new column in your pie chart as a legend:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
what have you used for the value in your bar chart , is it a measure ?
In a Pie chart, I used the Hostid column and changed the aggregation to count.
Appreciate your Kudos!!
i do now have another problem
when i filter on period , the color of my title legend is changing
how can i fix this
Try to fix set the colour manually first, then test it with filters:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos🙏
I did it but the problem is that the color of my legend tilte change , how can i fix it
User | Count |
---|---|
17 | |
14 | |
13 | |
13 | |
13 |
User | Count |
---|---|
19 | |
15 | |
14 | |
10 | |
9 |