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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.


Go to My LinkedIn Page


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.


Go to My LinkedIn Page


Thanks for quick solutions...

It's work 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.