cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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.

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.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors