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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
valWork
Frequent Visitor

Bar Chart value Comparison using a single date slicer for multiple date selection

Hi,

After posting previous question about bar chart comparison which use two slicers previously, I thought of making my visual more neat... thus I thought of using a single slicer which allow user to select the multiple date they want to compare and the DAX will use the lastDate from those selected value as the Base Value to compare against the other date, and find out the differences in revenue in those date.

E.g if user selected 13 May & 10th Jun, then the variance value should be 225.18.

But my current DAX does not seem to work that way, what is missing in my DAX? Looking for all the expert advise.

 

valWork_1-1717838075722.png

 

Many thanks again & your patience too.

Val

1 ACCEPTED SOLUTION

@valWork 
Sorry, it seems I didn't press ok or something.

I attached the pbix to this response you can download it now.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @valWork 

You are unable to calculate two different measures based on the same slicer due to the relationship between the calendar table and the main table. There are conflicting contexts here.

If you are interested in comparing based on a selection from one slicer, you can use a "disconnected" calendar table.

Ritaf1983_0-1717845116691.png

And then create measures like :

Sales 1 = CALCULATE([Total sales (K/$)],FILTER('orders',[Order Date]=min('Calendar (2)'[Date])))
Sales 2 = CALCULATE([Total sales (K/$)],FILTER('orders',[Order Date]=Max('Calendar (2)'[Date])))
Ritaf1983_2-1717845385242.png

The pbix is attached


If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks for the advise, I shall give it a try. I could not find the pbix, not sure if I miss out anything.

 

MAny thanks again.

@valWork 
Sorry, it seems I didn't press ok or something.

I attached the pbix to this response you can download it now.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Users online (1,376)