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
mohitchugh
Frequent Visitor

Dynamic Measure Required with two slicer

Hi Folks,

 

I'm trying to develop the dashboard by comparing two months and their uses of two slicers.

 

I prepared the dashboard using Excel Formulas. please help to develop Power-BI

As the Raw data is attached Excel is available. please refer it

 

mohitchugh_0-1711051854401.pngGoogle Drive Link for Excel File 

 

Please feel free to contact for more info if required.

 

RAW Data

PeriodAccountValue XValue YValue Z
FixTata435
FixBirla678
FixAdani789
FixRIL8910
FixTata91011
FixBirla101112
JanAdani111213
JanRIL121314
JanTata131415
JanBirla141516
JanAdani151617
FebRIL161718
FebTata171819
FebBirla181920
FebAdani192021
FebRIL202122
MarchTata212223
MarchBirla222324
MarchAdani232425
MarchRIL242526
MarchTata252627
MarchBirla262728
MarchAdani272829
AprilRIL282930
AprilTata293031
AprilBirla303132
AprilAdani313233
AprilRIL323334
AprilTata333435

 

Regards,

MOHIT

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, I could not access to the googledrive, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file whether it suits your requirement.

 

Jihwan_Kim_0-1711084565845.png

 

Jihwan_Kim_1-1711085120757.png

 

Fix: = 
CALCULATE (
    SUM ( Data[Value] ),
    REMOVEFILTERS ( Period ),
    Period[Period Number] = 0
)

 

Selected period: = 
SUM( Data[Value])

 

 

OFFSET function (DAX) - DAX | Microsoft Learn

 

Previous period: = 
VAR _previousperiodnumber =
    MAX ( Period[Period Number] ) - 1
VAR _condition = _previousperiodnumber <> 0
RETURN
    IF (
        _condition,
        CALCULATE (
            SUM ( Data[Value] ),
            OFFSET (
                -1,
                ALL ( Period[Period Number], Period[Period] ),
                ORDERBY ( Period[Period Number], ASC )
            )
        )
    )

 

Selected period fix: = 
[Selected period:] - [Fix:]

 

Diff: = 
[Selected period:] - [Previous period:]

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, I could not access to the googledrive, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file whether it suits your requirement.

 

Jihwan_Kim_0-1711084565845.png

 

Jihwan_Kim_1-1711085120757.png

 

Fix: = 
CALCULATE (
    SUM ( Data[Value] ),
    REMOVEFILTERS ( Period ),
    Period[Period Number] = 0
)

 

Selected period: = 
SUM( Data[Value])

 

 

OFFSET function (DAX) - DAX | Microsoft Learn

 

Previous period: = 
VAR _previousperiodnumber =
    MAX ( Period[Period Number] ) - 1
VAR _condition = _previousperiodnumber <> 0
RETURN
    IF (
        _condition,
        CALCULATE (
            SUM ( Data[Value] ),
            OFFSET (
                -1,
                ALL ( Period[Period Number], Period[Period] ),
                ORDERBY ( Period[Period Number], ASC )
            )
        )
    )

 

Selected period fix: = 
[Selected period:] - [Fix:]

 

Diff: = 
[Selected period:] - [Previous period:]

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thanks for quick solutions...

It's work 

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.