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

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.

Reply
Anonymous
Not applicable

Pie Chart behaviour without a legend (trying to simulate a legend without actually showing it)

Hello, I want to ask if it is actually possible to simulate the legend field behaviour in the default pie chart visual without actually adding a field in the legend.
The first 3 screenshots are how the "hacked" pie chart works now , as you can see in screenshot 3 : when i select a day of the week in 2018 it doesn't show the whole pie but only the day. However if i put the year field in the legend it works normally (screenshot 4).

The measure used in the donut is the following :

 Number of Customers donut =
VAR maxYear =
    CALCULATE ( MAX ( DimDate[Year] ), ALLSELECTED ( DimDate[Year] ) )
RETURN
    IF (
        HASONEFILTER ( DimDate[Year] ),
        CALCULATE (
            [Number of Customers],
            FILTER (
                ALL ( DimDate ),
                DimDate[DayOfWeek] = VALUES ( DimDate[DayOfWeek] )
                    && DimDate[Year] = VALUES ( DimDate[Year] )
                    && DimDate[Week] = VALUES ( DimDate[Week] )
                    && DimDate[DateKey] <= MAX ( DimDate[DateKey] )
            )
        ),
        CALCULATE (
            [Number of Customers],
            FILTER (
                ALL ( DimDate ),
                DimDate[DayOfWeek] = VALUES ( DimDate[DayOfWeek] )
                    && DimDate[Year] = maxYear
                    && DimDate[Week] = VALUES ( DimDate[Week] )
                    && DimDate[DateKey] <= MAX ( DimDate[DateKey] )
            )
        )
    )

Also the year slicer used has 2 values selected : 2018 and 2019.



Capture1.PNGCapture2.PNGCapture3.PNGCapture4.PNG

1 REPLY 1
Anonymous
Not applicable

up

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors