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.

0

Get the Sum of a Key Measure

I am trying to get the total amount of New Customers and Lost Customers but when I put the Key Measure in a card to get the total, it just says Blank.

 

I am using the below Key Measures to try to calculate sum: 

 

New Customer = IF([Revenue] & [Sales Last X Months] = BLANK(), BLANK(), IF([Revenue]=[Sales Last X Months],"New Customer"))
 
I've also used the number 1 instead of words to count but didn't work: 
# New Customer = IF([Revenue] & [Sales Last X Months] = BLANK(), BLANK(), IF([Revenue]=[Sales Last X Months],1))
 
Other calculations used:
Revenue = sumx(ZSD_VAIT_CV09,ZSD_VAIT_CV09[Revenue (+/-)])
 
Sales Last X Months = CALCULATE([Revenue],DATESINPERIOD('Date Table'[Date],LASTDATE('Date Table'[Date]),-[Month Value],MONTH))
 
Month Value is made from a parameter:
 
lackeyj_0-1658511110307.png
 
The Key Measure do not give me an option to count in the drop down either.
 
Please help, thank you!!
Status: Delivered

Hi @lackeyj,

 

According to the design, Power BI don’t provide an option to do calculation such as sum, count in the dropdown menu of measure. You need create new measure or calculated column to perform calculation by yourself. Card visual is normally used to display a single number, such as total sales calculated by aggregation function like sum. Card visualizations (large number tiles) - Power BI | Microsoft Docs

 

If you put your New Customer measure into a visual like Table, you should see the values evaluated in it just like the following screenshot showed. The New total is a measure created as your New Customer measure.

New total = IF([otherTotal] & [Total] = BLANK(), BLANK(), IF([otherTotal]=[Total],"New Customer"))

vcazhengmsft_0-1658730038936.png

 

Therefore, you need make some changes to your New Customer DAX formula. For example, SumTotal = [otherTotal]+[Total].

vcazhengmsft_1-1658730038938.png

 

If you still have problems on modifying your DAX formula, you could post your problem in DAX&Commands Tips forum where you will get prompted help.

DAX Commands and Tips - Microsoft Power BI Community

Re: How to Get Your Question Answered Quickly - Microsoft Power BI Community

 

Best Regards,                                                                                                                                                            Community Support Team _ Caiyun

Comments
v-cazheng-msft
Community Support
Status changed to: Delivered

Hi @lackeyj,

 

According to the design, Power BI don’t provide an option to do calculation such as sum, count in the dropdown menu of measure. You need create new measure or calculated column to perform calculation by yourself. Card visual is normally used to display a single number, such as total sales calculated by aggregation function like sum. Card visualizations (large number tiles) - Power BI | Microsoft Docs

 

If you put your New Customer measure into a visual like Table, you should see the values evaluated in it just like the following screenshot showed. The New total is a measure created as your New Customer measure.

New total = IF([otherTotal] & [Total] = BLANK(), BLANK(), IF([otherTotal]=[Total],"New Customer"))

vcazhengmsft_0-1658730038936.png

 

Therefore, you need make some changes to your New Customer DAX formula. For example, SumTotal = [otherTotal]+[Total].

vcazhengmsft_1-1658730038938.png

 

If you still have problems on modifying your DAX formula, you could post your problem in DAX&Commands Tips forum where you will get prompted help.

DAX Commands and Tips - Microsoft Power BI Community

Re: How to Get Your Question Answered Quickly - Microsoft Power BI Community

 

Best Regards,                                                                                                                                                            Community Support Team _ Caiyun