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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Filter Pie chart based on disconnected date table

Hi Community,

 

I have the following Pbix file:

https://www.dropbox.com/scl/fi/abmejaz39t7g6xro9z5d1/Test.pbix?rlkey=yv4pq8igcv8jw9jouovh55n5u&dl=0

 

I have a disconnected date table called PIDate which I use together with a filter Piname to select rows from the fact table (which is displayed in the table visual) based on the time frame in the PIDate. This works great together with a measure I have added to the table visual:

IsActiveMeasure =
SUMX (
    PIDate,
    SWITCH (
        TRUE (),
        MIN ( DimDate[Date]) >= MIN (PIDate[startdate])
            && MIN ( DimDate[Date] ) <= MAX(PIDate[enddate]) , 1,
        MAX ( DimDate[Date]) >= MIN ( PIDate[startdate])
            && MAX ( DimDate[Date]) <= MAX ( PIDate[enddate] ), 1
    )
)

I also have a main date table called DimDate, which relates to the fact table.

 

My main issue is that the pie chart does not get filtered based on the time frame from the PiDate when I select from the Piname filter. I have also tried writing a similar dax and applying it to the pie chart visual, but it doesn't work. How can I filter the pie chart based on the Piname filter. Your help is much appreciated.

 

dm_86_1-1697462575040.png

 

 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @Anonymous ,

Consider creating a virtual table and using it to iteratively sum.
For example:

Skipped 2 = 
SUMX (
    FILTER (
        SUMMARIZE (
            'Fact',
            'Fact'[tsexecutionid],
            "filtervalue", [IsActiveMeasure],
            "skipped", SUM ( 'Fact'[skipped] )
        ),
        [filtervalue] = 1
    ),
    [skipped]
)

Output:

vcgaomsft_0-1697614945395.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

4 REPLIES 4
v-cgao-msft
Community Support
Community Support

Hi @Anonymous ,

Consider creating a virtual table and using it to iteratively sum.
For example:

Skipped 2 = 
SUMX (
    FILTER (
        SUMMARIZE (
            'Fact',
            'Fact'[tsexecutionid],
            "filtervalue", [IsActiveMeasure],
            "skipped", SUM ( 'Fact'[skipped] )
        ),
        [filtervalue] = 1
    ),
    [skipped]
)

Output:

vcgaomsft_0-1697614945395.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Anonymous
Not applicable

Thanks @v-cgao-msft it works great, I never thought of that 🙂

 

I just adjusted it a bit to show all the data if nothing is selected, I hope that you agree 🙂

 

Skipped 2 = IF(SELECTEDVALUE(PIDate[id]),
SUMX (
    FILTER (
        SUMMARIZE (
            'Fact',
            'Fact'[tsexecutionid],
            "filtervalue", [IsActiveMeasure],
            "skipped", SUM ( 'Fact'[skipped] )
        ),
        [filtervalue] = 1
    ),
    [skipped]
),[skip])
Thejeswar
Community Champion
Community Champion

Hi @Anonymous ,

You can use USERELATIONSHIP() DAX to get the operation done if the tables are connected without actually connecting the tables.

 

This requires an inactive relationship to be present between the tables. Although this looks like the tables are connected, the join doesn't work unless you use the earlier said DAX funcrton

 

Regards,

Anonymous
Not applicable

Hi, this will not work.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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