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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
PetrS
Frequent Visitor

Line chart and Date selection

Hi all

I have a source with three columns: Date, Location, Quantity. I would like to do visual with table: Location, Quantity and Line chart: Date, Quantity. It is done, it is easy. But if I don't select a one date on Line chart, Table shows sum of quatities over all days and it is wrong. Is possible to see Line chart for all days and Table for the one -selected- day.
1. Default - automaticaly the select last day in the Line chart after open.
2. Allow to show quantity only for one day everytime in Table (based on the selection in Line chart)

Thank you for help

1 ACCEPTED SOLUTION

Hi @PetrS ,

 

Create 2 measures as below:

_quantity =
VAR _maxdate =
    CALCULATE ( MAX ( 'Table'[date] ), ALL ( 'Table' ) )
RETURN
    IF (
        ISFILTERED ( 'Table'[date] ),
        SUM ( 'Table'[quantity] ),
        CALCULATE (
            SUM ( 'Table'[quantity] ),
            FILTER (
                'Table',
                'Table'[date] = _maxdate
                    && 'Table'[location] = MAX ( 'Table'[location] )
            )
        )
    )
_quantitytotal = SUMX(VALUES('Table'[location]),'Table'[_quantity])

And you will see:

vkellymsft_0-1635491913661.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

View solution in original post

6 REPLIES 6
PetrS
Frequent Visitor

datadatacorrect view ... if I choose a daycorrect view ... if I choose a daywithout selection table shows sumwithout selection table shows sum

I took some screenshots. I hope it helps. I need to see quantities in Table only for one day. I don't know  ... update Table only if a one day is selected in Line chart or some conditions for Line chart selector. In the case of Stock time projection the sum is nonsense 😕

Greg_Deckler
Super User
Super User

@PetrS Would need sample data to be more specific but you can use Edit Interactions on the View menu to change the behavior of visuals interacting with one another. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

PetrS_0-1635336700451.png

 

data

PetrS_1-1635336700478.png

 

correct view ... if I choose a day

PetrS_2-1635336700492.png

 

without selection table shows sum

I took some screenshots. I hope it helps. I need to see quantities in Table only for one day. I don't know  ... update Table only if a one day is selected in Line chart or some conditions for Line chart selector. In the case of Stock time projection the sum is nonsense 

PetrS_3-1635336700079.png

 

 

Hi @PetrS ,

 

Create 2 measures as below:

_quantity =
VAR _maxdate =
    CALCULATE ( MAX ( 'Table'[date] ), ALL ( 'Table' ) )
RETURN
    IF (
        ISFILTERED ( 'Table'[date] ),
        SUM ( 'Table'[quantity] ),
        CALCULATE (
            SUM ( 'Table'[quantity] ),
            FILTER (
                'Table',
                'Table'[date] = _maxdate
                    && 'Table'[location] = MAX ( 'Table'[location] )
            )
        )
    )
_quantitytotal = SUMX(VALUES('Table'[location]),'Table'[_quantity])

And you will see:

vkellymsft_0-1635491913661.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

It works, thank you a lot.

Hi  @PetrS ,

 

Glad to help.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

Helpful resources

Announcements
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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