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
mgtulips
New Member

line chart with two slicers of custom dates and two date tables

newbie here need help.

 

i found a solution based from this video: https://www.youtube.com/watch?v=QPVSxxoN5sg, about using two slicers as input. my org requires users to select custom dates:
z_dates.jpg

 

the line chart works great for the sales and plan (based on Timeframe dates) but Comparison Sales (based on versus Timeframe) is incorrect and overstated.
Total Sales: $42m
Total Plan: $44m
Comparison Sales: $347m (??? not right)
z_line_chart.jpg

 

 measure:

Comparison Sales =

CALCULATE(

SUM(SALES_SUMMARY[SALES]), ALL(CALENDAR), USERELATIONSHIP(SALES_SUMMARY[DATE],'COMPARISON CALENDAR'[DATE])

)

thank you!

2 REPLIES 2
amitchandak
Super User
Super User

@mgtulips , if you have these dates you can have 2 lines, not one overlapping.

 

Both need to independent Date table slicer and you can have two measures like

 

//Date1 is independent Date table and Date is Joined
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

//Date2 is independent Date table and Date is Joined
new measure 2 =
var _max = maxx(allselected(Date2),Date2[Date])
var _min = minx(allselected(Date2),Date2[Date])
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Power BI How to use/compare two Date/Period slicers: https://youtu.be/WSeZr_-MiTg

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

thank you for the immediate response.

 

i took the file from one of the videos and was able to replicate the issue i described.

can you take a look at it?
range2 seem to be adding all the months, instead of breaking it down by day
I would include the pbix, i cant find the option to do that.

z_table.jpg

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.