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
Anonymous
Not applicable

Need help with DAX Formulation for sum using equality operator Date columns

Hi,

I have an input method format as shown below in the image(which is obtained through powerapps)

Humbledore_0-1604424473209.png

 

Where the input date has a 'one to one' relationship with the dim date table

Illustration Purpose: This is how values are stored in the dashboard

Humbledore_1-1604424473230.png

 

     Dim input table     

Humbledore_2-1604424473242.png

 

DAX Formula

Humbledore_3-1604424473251.png

 

By using the above formulation I want to achieve the following output:

Humbledore_4-1604424473257.png

 

But I get this as my output

Humbledore_5-1604424473261.png

 

Am I missing out something in the formulation?

1 ACCEPTED SOLUTION

this code might work

Output=VAR vCurrentDate=max(dimDateTable[Date]) RETURN CALCULATE(SUM(Input[Value]),Input[Date]<=VCurrentDate)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @AntrikshSharma ,

Thanks for the reply 

But my values dont get stored as different columns but as a single view for each input case

For example: For input- Input value- 300 @ input date: jun 2021

jun 20200
dec 20200
jun 2021300
dec 2021300
jun 2022300
dec 2022300
 

For input- Input value- 100 @ input date: dec 2021

jun 20200
dec 20200
jun 20210
dec 20210
jun 2022100
dec 2022100

So each of it is a single view and then finally i want to add them similar to final input above

this code might work

Output=VAR vCurrentDate=max(dimDateTable[Date]) RETURN CALCULATE(SUM(Input[Value]),Input[Date]<=VCurrentDate)

Anonymous
Not applicable

Thanks mate!

Worked like a charm

AntrikshSharma
Community Champion
Community Champion

@Anonymous  Try something like this:

=
SUMX (
    DimInputTable,
    DimInputTable[Column 1] + DimInputTable[Column 2] + DimInputTable[Column 3]
)

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors