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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
tonny_bwg
Helper I
Helper I

Dynamic display inventory value for Past N period based on selected slicers value

Hi, Gurus
 I want to create a report to dynamicly show inventory value based on slicers select. 
for example: currently Month and 202307 are selected. Parameter sets to 5, the chart will show the inventory value from 202302 to 202307.  Quater and Year are the same logic.  how to create a dynamic inventory value measure to switch to difference value accoring to the selection.
thanks for your help.

--Tonny

tonny_bwg_0-1690361795971.png

tonny_bwg_1-1690362224706.png

Date slicers DAX:
dim_Date3 =
 VAR _t1 =
        SELECTCOLUMNS(dim_Date,
                      "Date", [Date],
                      "Display", [Year],
                      "Sequence", [ySequence],
                      "Type", "Year",
                      "TypeId",3)
 VAR  _t2 =
        SELECTCOLUMNS(dim_Date,
                      "Date", [Date],
                      "Display", [Year]&[Quarter],
                      "Sequence", [qSequence],
                      "Type", "Quarter",
                      "TypeID",2)

 VAR _t3 =
      SELECTCOLUMNS(dim_Date,
                      "Date", [Date],
                      "Display", [YearMonth],
                      "Sequence", [mSequence],
                      "Type", "Month",
                      "TypeID",1)

 Return
   UNION(_t1,_t2, _t3)

 

0 REPLIES 0

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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