Forum Discussion

Do57792's avatar
Do57792
Advocate I
1 year ago
Solved

Pie chart from Measure

Hello Gurus,

 

some questions regarding to the problem have already been raised up, but I wasn't able to figure out the right solution 🤔

Following data:

HouseHouse-PartFinishing date PlanFinishing date real
1101 Jan01 Jan
1202Feb02 Feb
1304 Mar06 Jun
2103 Sep03 Sep
3301 Jan01Jan


Additionally I have a slicer for the planned Finishing dates. 

If the planned date = real finishing date then the House part is on time; if every house part is on time then the whole house is on time.

Here is the point: If I select the timespan from Jan to April then House 1 is not in time. If I select the timespan from Jan to 05 Feb. then House 1 is on time. Therefor I have created a measure which is working fine at the table, but now the plan is that there will be a pie chart to see the houses wich are o ntime and which are not in time.

Do you have any idea?


4 Replies

  • Hi Do57792 ,

     

    Sounds like your measure logic is already solid, so the next step is shaping it for a pie chart. Here's how you can approach it:

    1. Create a new measure that returns a label like "On Time" or "Not On Time" per house. Something like:
    HouseStatus =
    IF(
        CALCULATE(
            COUNTROWS(HouseParts),
            HouseParts[PlannedDate] <> HouseParts[RealDate]
        ) = 0,
        "On Time",
        "Not On Time"
    )
    1. Build a summary table using SUMMARIZE or a calculated table if needed:
    HouseSummary =
    SUMMARIZE(
        HouseParts,
        HouseParts[House],
        "Status", [HouseStatus]
    )
    1. Use that status in your pie chart:
      • Axis: Status
      • Values: Count of House or DISTINCTCOUNT(HouseParts[House])

    This way, your pie chart will show how many houses are fully on time vs not, based on the selected date range.

    Also, make sure your slicer is filtering the date range correctly so the measure reflects the right context.

     

    If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
    translation and formatting supported by AI