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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
FatBlackCat30
Microsoft Employee
Microsoft Employee

subtract two values in a graph

hi all,

 

I am trying to create a DAX measure that will subtract the users & the devices for the dates 6/30/2017 & 6/30/2018

 

So I want the DAX measure to do 150000-180000 and 250405 - 548080

 

Attributes6/30/20176/30/2018FY18 YoY Growth (want to create with dax)
Users150000180000=C2-B2
devices250405548080=C3-B3
Total =SUM(B2:B3)=SUM(C2:C3)=SUM(D2:D3)

 

what would be the best approach to do this?

 

thank you!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@FatBlackCat30 , You can join with a date table and use trailing year measure

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

diff = SUM(Sales[Sales Amount])- [Year behind Sales]

 

In case you want to select two dates and do it :https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1...
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/...

vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc

 

 

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

Anonymous
Not applicable

Hi @FatBlackCat30 ,

 

Based on your description, you can create a measure as follows.

 

difference = SUMX('Case1',[6/30/2017]-[6/30/2018])

 

Result:

v-yuaj-msft_0-1605746995136.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @FatBlackCat30 ,

 

Based on your description, you can create a measure as follows.

 

difference = SUMX('Case1',[6/30/2017]-[6/30/2018])

 

Result:

v-yuaj-msft_0-1605746995136.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@FatBlackCat30 , You can join with a date table and use trailing year measure

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

diff = SUM(Sales[Sales Amount])- [Year behind Sales]

 

In case you want to select two dates and do it :https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1...
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/...

vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc

 

 

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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