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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
vinodDrinkPak
Helper II
Helper II

End of Week and End of Month Selection issues

Hi Experts,

 

i need help with 2 things

1) below is the view of the dashboard, 1st support is whenever i select End of Week or End of Month, it should show only Current Week and Past 5 weeks Values and Current Month and Past 5 Months based on the Dropdown selection, it should be dynamic

 

2) also i see my Card Values and Bar graph values are not changing based on the Dropdown Selection made, seems like a Measure or Dax issue. thank you for the help and support

 

vinodDrinkPak_0-1694098961343.png

 

here is my pbix file 

https://drive.google.com/file/d/1EP3BMNtm3ueuFrl0V9a_S5QB_tDXWas6/view?usp=sharing

 

any help on this is highly appreciated

 

2 REPLIES 2
amitchandak
Super User
Super User

@vinodDrinkPak , Create an independent date table and create these two measures with help of that

 

//Date1 is an independent Date table, Date is joined with Table
5 month  =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -5) +1
return
calculate( sum(sales[Gross Sales]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

 

//Date1 is independent Date table, Date is joined with Table
5 week  =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = _max -5*7 
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

you can use that visual with week or month connected date 1

 

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

 

Also, you can use a create field parameter with week end date and Month End Date from date table swap measure

 

Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
Field Parameters- Conditional Formatting: https://amitchandak.medium.com/field-parameters-conditional-formatting-517aacc23fdf

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

 

wow Fantastic!! you are pro!

only thing it doesn't do is (End of month, End of Week Dropdown) it doesn't filter my card value and Bar graph

 i am using the below measure to display my card and graph values

Inbound =
DISTINCTCOUNT(RECEIPT_CONTAINER[CONTAINER_ID])+0
 
below are the measure you have  provided for my line graphs which works fantastic, what should i do, so that it works with my Card and Graph
you have great content in youtube, i am going to recommend this to others as well
 
Inbound Week =
VAR __END_DATE =
    MAXX(ALLSELECTED('Dates(Disconnected)W'),'Dates(Disconnected)W'[End of Week])
VAR __START_DATE =
    __END_DATE -6*7
RETURN
    CALCULATE(
        DISTINCTCOUNT(RECEIPT_CONTAINER[CONTAINER_ID]),
        FILTER(
            RECEIPT_CONTAINER,
            RECEIPT_CONTAINER[End of Week] >= __START_DATE
                && RECEIPT_CONTAINER[End of Week] <= __END_DATE
        )
    )
 
InboundEOM =
VAR __END_DATE =
    MAXX(ALLSELECTED('Dates(Disconnected)M'),  'Dates(Disconnected)M'[End of Month])
VAR __START_DATE =
    EOMONTH(__END_DATE,-6)+1
RETURN
    CALCULATE (
        DISTINCTCOUNT ( RECEIPT_CONTAINER[CONTAINER_ID] ),
        FILTER (
            RECEIPT_CONTAINER,
            RECEIPT_CONTAINER[End of Month] >= __START_DATE
                && RECEIPT_CONTAINER[End of Month] <= __END_DATE
        )
    )

 

 

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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