Forum Discussion
harshadrokade
4 years agoPost Partisan
Column chart with most recent two date values
Ashish_Mathur Since you alredy created a pbix file on this, sharing this with you. I have below data & I have slicers on Month, Student name & Subject name I want a column chart created that ...
- Anonymous4 years ago
Hi harshadrokade ,
I updated the sample pbix file, please check whether it can return your expected result. You can find the details in the attachment.
1. Create a date dimension table(DO NOT create any relationship with your fact table)
Date = VALUES('Table'[Month-DD/MM/YYYY])2. Update the formula of measure [] as below
Most recent two date values = VAR _selstu = SELECTEDVALUE ( 'Table'[Student name] ) VAR _selsubject = SELECTEDVALUE ( 'Table'[Subject name] ) VAR _maxdate = SELECTEDVALUE ( 'Date'[Month-DD/MM/YYYY] ) VAR _secondmdate = CALCULATE ( MAX ( 'Table'[Month-DD/MM/YYYY] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Month-DD/MM/YYYY] < _maxdate ) ) RETURN CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Month-DD/MM/YYYY] IN { _maxdate, _secondmdate } ) )3. Apply the date field as slicer option to replace the field in fact table
Best Regards
harshadrokade
4 years agoPost Partisan
HI Greg_Deckler
Your post on below link helped me to filter the months based on other calendar table slicer. The only issue I am facing is that since the slicer value is selected from other delinked table, the other visuals that I have created from sales table are not getting filetered when I change the date. How can I manage this?