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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
FatBlackCat30
Employee
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

 

 

View solution in original post

v-yuaj-msft
Community Support
Community Support

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
v-yuaj-msft
Community Support
Community Support

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

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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