Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Count of distinct date count value

In PowerBI I have datekey column in my table & based on this column I created date column & based on date column I created month column also. Bus run days is count of distinct date column. Now the re...
  • OguzMavice's avatar
    2 years ago

    Hi Anonymous ,

     

    I understand that your goal is to see bus services that meet these criteria when the desired month and year are selected and the number of operating days you want for this selection.  For this target, I will design a pbi file with all metrics. Let me clarify my techinque.

     

    First, I created # vol mesaure =

    DISTINCTCOUNT('SampleFile - Copy'[date_key])
     
    Then , I created numeric parameter in order to select range( in your question, you mentioned less than 15 distinct date as a selection )
     
    Then, I created filtering measure in order to filter out our data by our wish. 
    Selection Filter = IF([# Vol]<=Selection[Selection Value],1,0)
     

     If you use the confiquration of " selection_filter =1" for your main visual ( right on the page) you can filter your data both month-year and numeric selection. 

     

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