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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
AllanXu
Helper II
Helper II

DAX Forum?

Greetings,

 

Is there any active DAX form, so I can post my DAX related questions there?

 

Thank you,

 

4 REPLIES 4
sai1995
Microsoft Employee
Microsoft Employee

 

PPO Qty v2 =

SUMX(VALUES('DimDate1'[Month]),CALCULATE (

    SUM ( 'PPO Report'[PPO Req. quantity]),

    USERELATIONSHIP ( 'PPO Report'[PPO Delivery date], 'DimDate1'[Date] )

))

 

 

 

 

 

Patrick-G
New Member

 Hi,

 

I am trying to create a rail period date table using DAX to be dynamic and have no idea where to start; any help will be much appreciated. Cheers!

 

Example There are 13 periods in total.

DatePeriodsFiscal YearStart DateEnd DateDuration
01 April 2020P12020-2101 April 202002 May 202032
02 April 2020P12020-2101 April 202002 May 202032
03 April 2020P12020-2101 April 202002 May 202032
04 April 2020P12020-2101 April 202002 May 202032
05 April 2020P12020-2101 April 202002 May 202032
06 April 2020P12020-2101 April 202002 May 202032
07 April 2020P12020-2101 April 202002 May 202032
08 April 2020P12020-2101 April 202002 May 202032
09 April 2020P12020-2101 April 202002 May 202032
10 April 2020P12020-2101 April 202002 May 202032
11 April 2020P12020-2101 April 202002 May 202032
12 April 2020P12020-2101 April 202002 May 202032
13 April 2020P12020-2101 April 202002 May 202032
14 April 2020P12020-2101 April 202002 May 202032
15 April 2020P12020-2101 April 202002 May 202032
16 April 2020P12020-2101 April 202002 May 202032
17 April 2020P12020-2101 April 202002 May 202032
18 April 2020P12020-2101 April 202002 May 202032
19 April 2020P12020-2101 April 202002 May 202032
20 April 2020P12020-2101 April 202002 May 202032
21 April 2020P12020-2101 April 202002 May 202032
22 April 2020P12020-2101 April 202002 May 202032
23 April 2020P12020-2101 April 202002 May 202032
24 April 2020P12020-2101 April 202002 May 202032
25 April 2020P12020-2101 April 202002 May 202032
26 April 2020P12020-2101 April 202002 May 202032
27 April 2020P12020-2101 April 202002 May 202032
28 April 2020P12020-2101 April 202002 May 202032
29 April 2020P12020-2101 April 202002 May 202032
30 April 2020P12020-2101 April 202002 May 202032
01 May 2020P12020-2101 April 202002 May 202032
02 May 2020P12020-2101 April 202002 May 202032

 

 

msanto
New Member

This function should return values in an interval of 90, days, 180 days, 360 days, according to the selected one, but it is not doing so. Could you help me?

 

Valor Stock Parado:=
var valor=0
VAR vSelectedMenu =
IF ( HASONEVALUE ( 'Menu Qtd Valor'[Menu]), VALUES ( 'Menu Qtd Valor'[Menu] ) )

RETURN
-SWITCH (
TRUE (),
vSelectedMenu = "Valor",
VAR vSelectedMenuType =
IF ( HASONEVALUE ( 'SubMenu Stock Parado'[Measure]), VALUES ( 'SubMenu Stock Parado'[Measure] ) )
RETURN
SWITCH (
TRUE (),
vSelectedMenuType = "90 dias",if(iSBLANK(CALCULATE(SUM('Vendas Sell-In'[Valor Sell-In]), DATESINPERIOD(Data[Data], MAX (Data[Data]),-90,DAY))), TRUE() , SUM('Vendas Sell-In'[Valor Sell-In])),
vSelectedMenuType = "180 dias",IF(iSBLANK(CALCULATE(SUM('Vendas Sell-In'[Valor Sell-In]), DATESINPERIOD(Data[Data], MAX (Data[Data]),-180,DAY))), TRUE() , SUM('Vendas Sell-In'[Valor Sell-In])),
vSelectedMenuType = "360 dias", IF(iSBLANK(CALCULATE(SUM('Vendas Sell-In'[Valor Sell-In]), DATESINPERIOD(Data[Data], MAX (Data[Data]),-360,DAY))), TRUE() , SUM('Vendas Sell-In'[Valor Sell-In])),
0 )
,
vSelectedMenu = "Qtd",
VAR vSelectedMenuType2 =
IF ( HASONEVALUE ( 'SubMenu Stock Parado'[Measure]), VALUES ( 'SubMenu Stock Parado'[Measure] ) )
RETURN
SWITCH (
TRUE (),
vSelectedMenuType2 = "90 dias",IF(iSBLANK(CALCULATE(SUM('Vendas Sell-In'[Qtd Sell-In]), DATESINPERIOD(Data[Data], MAX (Data[Data]),-90,DAY))), TRUE() , SUM('Vendas Sell-In'[Valor Sell-In])),
vSelectedMenuType2 = "180 dias",IF(iSBLANK(CALCULATE(SUM('Vendas Sell-In'[Qtd Sell-In]), DATESINPERIOD(Data[Data], MAX (Data[Data]),-180,DAY))), TRUE() , SUM('Vendas Sell-In'[Valor Sell-In])),
vSelectedMenuType2 = "360 dias", IF(iSBLANK(CALCULATE(SUM('Vendas Sell-In'[Qtd Sell-In]), DATESINPERIOD(Data[Data], MAX (Data[Data]),-360,DAY))), TRUE() , SUM('Vendas Sell-In'[Valor Sell-In])),
0 )
, 0
)

+

the second variable is used for a button that switches between quantity and value

Thank guys

GTR
Helper III
Helper III

You're in the right place, DAX questions can be posted here. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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