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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tina345
Helper II
Helper II

Display value from today & last month from a query

Hello Experts,

I have data set like this.

I am trying to come up with 2 cards with side by side comparision of value (today vs last day of last month).Do we need to create 2 different measures ?Could you please help on how to achieve this?

 

Date, Value
-------------
6/1/2021,100
6/2/2021,200
6/30/2021,300 -- Last Month Value
7/1/2021,400
7/14/2021,500 -- Today's Value

 

Expected Result as of 7/14/2021

-------------------------------------

300 , 500

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @tina345 ,

Here are the steps you can follow:

1. Create measure.

lastdate =
CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Date]=EOMONTH(TODAY(),-1)))
Today = CALCULATE(SUM('Table'[Value]),'Table'[Date]=TODAY())
IF =
IF([lastdate]>[Today],"True","Flase")

2. Place it in the Mutli -row card

vyangliumsft_0-1626762862123.png

3. Result:

Three measures will be placed in a Card to display all the results

vyangliumsft_1-1626762862124.png

 

Best Regards,

Liu Yang

View solution in original post

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @tina345 ,

Here are the steps you can follow:

1. Create measure.

lastdate =
CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Date]=EOMONTH(TODAY(),-1)))
Today = CALCULATE(SUM('Table'[Value]),'Table'[Date]=TODAY())
IF =
IF([lastdate]>[Today],"True","Flase")

2. Place it in the Mutli -row card

vyangliumsft_0-1626762862123.png

3. Result:

Three measures will be placed in a Card to display all the results

vyangliumsft_1-1626762862124.png

 

Best Regards,

Liu Yang

tina345
Helper II
Helper II

I got it, we can use multiple conditions.

There is some syntax issue.

 

Thaks a lot.

amitchandak
Super User
Super User

@tina345 ,Try two measures like

 

calculate(sum(Table[Value]), filter(Table, Table[Date] = today()))

 

 

calculate(sum(Table[Value]), filter(Table, Table[Date] = eomonth(today(),-1)))

Thanks Amitchandak,

   If I have to add one more filter, what is the easiest way to do that?

   There will be 2 filter, and looks like sum takes only 1 argument.

    I am getting too many arguments to the Sum function error message.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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