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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
miltenburger
Helper V
Helper V

Unique users with costs per month by selected filters

Hi Guys,

 

I'm trying to measure and show all my clients who made costs in a selected period. 

The thing i've got now, is that it only shows me the grand total over my selected period, instead of the differences in months.

 

Measures i've made:

Sum of cost = 
CALCULATE(
    SUM('Fact.VoorzieningZINBesteding'[Kosten ZIN]),
    FILTER(
        ALLSELECTED('Fact.VoorzieningZINBesteding'),
        'Fact.VoorzieningZINBesteding'[BSN Gepseudonimiseerd] = SELECTEDVALUE('Fact.VoorzieningZINBesteding'[BSN Gepseudonimiseerd])))

 

 

Cliënten met kosten = CALCULATE(DISTINCTCOUNT('Fact.VoorzieningZINBesteding'[BSN Gepseudonimiseerd]), filter (ALLSELECTED('Fact.VoorzieningZINBesteding'), 'Fact.VoorzieningZINBesteding'[Sum of cost] > 0 ))

 

 

Result:

Costs.PNG

 

What I expect (this is other example, not the measure as shown before)

result.PNG

 

 

 

 

 

 

 

 

 

Got any ideas on how to achieve this? Thx in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@miltenburger , As per me the measure should be

 

divide(SUM('Fact.VoorzieningZINBesteding'[Kosten ZIN]),DISTINCTCOUNT('Fact.VoorzieningZINBesteding'[BSN Gepseudonimiseerd]))

 

You need handle the selected value if tables are not joined or not from same table

 

you can use allselected in denominator if you want all users

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@miltenburger , As per me the measure should be

 

divide(SUM('Fact.VoorzieningZINBesteding'[Kosten ZIN]),DISTINCTCOUNT('Fact.VoorzieningZINBesteding'[BSN Gepseudonimiseerd]))

 

You need handle the selected value if tables are not joined or not from same table

 

you can use allselected in denominator if you want all users

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.