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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JCA
Frequent Visitor

Multiple selection bar chart to generate variance calculation

Hi All,

 

I have a set of financial data containing a Month and a Value

 

Displayed as a Bar chart, Month as my X and Value as my Y

 

Is it possible for a user to select two months, Say April 2023 to Sept 2023 and generate a variance between the selection in a table with other information?

 

The goal is to consider paybill growth

 

I have this working where I can using a slicer select Month 1 and then Month 2, this then generates  a vairance but I would like a slicker user experence than reliance on 2 slicers

 

Alterntively if I use the slicer to Select Month 1 and then Month 2 could I have a chart display all data between some how?

 

Thanks

 

JCA

2 REPLIES 2
v-yaningy-msft
Community Support
Community Support

Hi, @JCA 

May I ask if this is the expected output you are looking for? Based on your description, I have created a measure to achieve the effect you are looking for. Following picture shows the effect of the display.

vyaningymsft_1-1705387770452.png

 

 

Measures:

 

ValueByDate =

VAR _dateStart =

    SELECTEDVALUE ( 'DateStart'[DateStart] )

VAR _dateEnd =

    SELECTEDVALUE ( DateEnd[DateEnd] )

VAR _showInfo =

    CALCULATE (

        SUM ( 'Table'[Value] ),

        'Table'[Date] >= _dateStart

            && 'Table'[Date] <= _dateEnd

    )

RETURN

    _showInfo

 

 

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
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

 

HI,

 

Thanks for the reply!

 

That's basically the same Dax as I came up with; however, rather than interacting via a pair of slicers for DateStart and DateEnd, I was wondering if it is possible to pick up from a selection off a bar chart?

 

Or

 

Generate a Barchart from StartDate to EndDate.

 

Thanks

 

JCA

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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