March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I'm trying to create a matrix/table visual that contain the total customer order until a certain month (ex. Dec 2022) and the next month (Jan 2023) customer order.
Dataset:
Item | Date | Customer Order (QTY) |
Ice Cream | 01/01/2021 | 10 |
Ice Cream | 02/02/2021 | 10 |
Candy | 01/02/2021 | 20 |
Ice Cream | 01/12/2022 | 10 |
Candy | 02/12/2022 | 20 |
Ice Cream | 03/12/2022 | 20 |
Ice Cream | 04/12/2022 | 30 |
Ice Cream | 01/01/2023 | 30 |
Candy | 02/01/2023 | 20 |
Ice Cream | 03/01/2023 | 20 |
Ice Cream | 02/02/2023 | 10 |
Ice Cream | 03/02/2023 | 20 |
Candy | 04/02/2023 | 30 |
Ice Cream | 01/03/2023 | 10 |
Ice Cream | 02/03/2023 | 20 |
Candy | 03/03/2023 | 30 |
for example i want to check the accumulated month Customer Order in Dec 2022, it should add all the previous date Customer Order Qty until Dec 2022 (red color), and the next month Customer Order QTY will be add for Jan 2023 only (blue color).
The result should be like:
Until Dec-2022 | Jan-23 | |
Ice Cream | 80 | 50 |
Candy | 40 | 20 |
Is this possible to done in a single matrix/table visual?
Solved! Go to Solution.
@BryanJun , You can have two measures
This Month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0)
return CALCULATE(Sum(Table[Customer Qty]), FILTER('Table','Table'[Date] >=_min && 'Table'[Date] <= _max))
before this month
=
var _max = eomonth(today(),-1)
return CALCULATE(Sum(Table[Customer Qty]), FILTER('Table', 'Table'[Date] <= _max))
based on selected date or today
This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1)+1
return
return CALCULATE(Sum(Table[Customer Qty]), FILTER('Table','Table'[Date] >=_min && 'Table'[Date] <= _max))
before This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),-1)
return
return CALCULATE(Sum(Table[Customer Qty]), FILTER('Table', 'Table'[Date] <= _max))
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
since it shows all the future QTY in every month, can it be limit by just showing next 1 month (Jan-2023)?
Try to edit the measure yourself. Try also to change the filter condition in the filter pane.
@BryanJun , You can have two measures
This Month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0)
return CALCULATE(Sum(Table[Customer Qty]), FILTER('Table','Table'[Date] >=_min && 'Table'[Date] <= _max))
before this month
=
var _max = eomonth(today(),-1)
return CALCULATE(Sum(Table[Customer Qty]), FILTER('Table', 'Table'[Date] <= _max))
based on selected date or today
This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1)+1
return
return CALCULATE(Sum(Table[Customer Qty]), FILTER('Table','Table'[Date] >=_min && 'Table'[Date] <= _max))
before This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),-1)
return
return CALCULATE(Sum(Table[Customer Qty]), FILTER('Table', 'Table'[Date] <= _max))
Hi,
Thank you, this is what i want!!
Is that having any method to change the column name dynamically according to current month and year?
(ex: Dec-2022, Jan-2023)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |