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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
Users online (25)