Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Vidya1882
Frequent Visitor

Monthwise count of HCP by segment

Hi 

     i have table named "HCP" contain column named "hcpid" and column "month".and i have island table named "RFS table"(doesnot have any relationship) column "RFS Segment".segemnt also silcer visual.now i need a bar chart, x axis "month" ,Y axis "count of hcpid",legend is "RFS segment".if i applied any filter from " RFS Segment" it want to impact in bar chart.
Uniq HCPs = count (hcpid)
below is a logic i used,
RFS_HCPCOUNT_Bar = 
VAR Summary = SUMMARIZE(HCP[hcpid],HCP[MONTH], "segment", [RFS Segment])
VAR Grouped = GROUPBY(Summary,HCP[MONTH],[segment], "counthcp", COUNTX(CURRENTGROUP(), hcpid))
RETURN
SWITCH(
    SELECTEDVALUE('RFS Table'[RFS Segment]),
    "Star", CALCULATE(SUMX(FILTER(Grouped, [enagae] = "Star"), [counthcp])),
    "Potential", CALCULATE(SUMX(FILTER(Grouped, [enagae] = "Potential"), [counthcp])),
    "Dormant", CALCULATE(SUMX(FILTER(Grouped, [enagae] = "Dormant"), [counthcp])),
    "Need Attention", CALCULATE(SUMX(FILTER(Grouped, [enagae] = "Need Attention"), [counthcp])),[Uniq HCPs]
)

this is not working in measure view.even if applied filter its not working.

 

how to slove this error?

2 REPLIES 2
v-yifanw-msft
Community Support
Community Support

Thank you @lbendlin  for your prompt reply.

Hi @Vidya1882 ,

As @lbendlin  said, providing some sample data with the output you want to get can help us better understand and solve your problem.

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.