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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Filter by month on count distinct

Hi Everybody

I have a list of project as a source to my report. For each project there is a column which say which platform was used in this specific project, if non the cell is blank. I have counted the number of unique used platforms for these projects, by creating a measure:

Distinct Count of Platform used difference from (Blank)=
VAR __BASELINE_VALUE =
    CALCULATE(
        DISTINCTCOUNT('Investments'[Platform used]),
        ISBLANK('Investments'[Platform used])
    )
VAR __MEASURE_VALUE = DISTINCTCOUNT('Investments'[Platform used])
RETURN
    IF(NOT ISBLANK(__MEASURE_VALUE), __MEASURE_VALUE - __BASELINE_VALUE)
 
This shows me correct result on overall level (all months), however I have to be able to filter this by months.
If I do this using the formula above the result is incorrect, I think that it first filter the projects by month and then counts distinct difference from blanks. What I need to get is number of unique platforms used overall in each month.
 
Thanks in advance for any kind of help!
 
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

With what is wrong and what is expected .

 

Also, try this return

 

RETURN
sumx(Values('Investments'[Month Year]),IF(NOT ISBLANK(__MEASURE_VALUE), __MEASURE_VALUE - __BASELINE_VALUE))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

BarKur_2-1600426800947.png

 

If I include all data the visual table shows correct info about unique used platforms. However if I filter it by month(for ex August) then platform used(BX2) in other month(February) shows as unique used in August which is not true. I want it to show only platforms used for the first time ever(all data) as unique used in each month.

 

Unfortunately RETURN that you proposed do not solve this problem.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors