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.

Reply
vaibbandge
Frequent Visitor

how to show the difference between the amounts of two quarters which I select from slicer

Hello team,

 

I am new to Power BI DAX, and I wants to show the differerence between the amount of 1 quarter with another.

If suppose I select Q1 2021 and Q2 2021 from my Quarter slicer then results should come like below-

 

Product DescriptionQ1 2021
($000)
Q2 2021
($000)
$ Change
($000)
% Change
A$67,957$67,726($231)0%
B$27,716$26,050($1,666)-6%
C$7,692$9,275$1,58321%
D$6,974$7,863$88813%

 

 

Below is my sample data -

Product NameQuarterYearINVOICEDATEChargeAmount
AQ1 20212/28/20217126816.01
AQ2 20215/31/20216054198.33
BQ2 20214/30/20215879113.68
BQ1 20211/31/20215293888.03
CQ2 20216/30/20214904149.4
AQ1 20213/31/20214372781.54
BQ1 20211/5/20213754678.19
DQ1 20213/29/20213577814.64
EQ2 20216/29/20213286894.5

 

Any help is much appreciated...!

2 REPLIES 2
vaibbandge
Frequent Visitor

Hi @amitchandak ,

thanks for reply ..!

I tried the measure which you sent but it doesnt work for me. can you please create pbix file for the sample data which I sent in my 1st post and sent me that pbix file so that I can refer it in my desktop .

 

amitchandak
Super User
Super User

@vaibbandge , a measure like

 


Measure =
VAR _max = MAXX(allselected('Date1'),'Date1' [Qtr Year]) // prefer to have column Year Qtr in table and use that here, ui you can use Qtr Year
var _min = MinX(allselected('Date1'),'Date1' [Qtr Year])
return
calculate(sum(Table[value]), filter(('Date') , 'Date1' [Qtr Year] = _max )) - calculate(sum(Table[value]), filter(('Date') , 'Date1' [Qtr Year] =_min ))

 

 

I assumed use of date table

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors