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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Chandramouli_BI
Helper III
Helper III

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 requirement of client is they wanted to check month wise or year wise bus run days which is count of distinct dates. For example they might want to know in month of july & year 2023 buses run less than 15 days. Based on this I used month slicer & count of distinct date slicer as a range. Based on these 2 slicers I want to see the buses. But after selecting month slicer(Ex: June) I wanted to check buses run less than 15 days so, I selected a range from 1 to 15. But the I am getting blank values.

 

Please find the sample file below

 

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

1 ACCEPTED SOLUTION
OguzMavice
Resolver II
Resolver II

Hi @Chandramouli_BI ,

 

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)
 
OguzMavice_0-1701028415802.png

 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.

 

 

View solution in original post

1 REPLY 1
OguzMavice
Resolver II
Resolver II

Hi @Chandramouli_BI ,

 

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)
 
OguzMavice_0-1701028415802.png

 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.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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