Forum Discussion
Creating a Table visual in Power Bi
- 3 years ago
Hi Anonymous
just noticed you wanted a cummulative total, then
Supposing you have the following data:
ActualDate DueDate Gap Amt 10/5/2022 10/1/2022 -4 10 10/28/2022 11/1/2022 4 50 11/30/2022 12/1/2022 1 70 12/26/2022 1/1/2023 6 100 1/31/2023 2/1/2023 1 10 2/20/2023 3/1/2023 9 90 3/22/2023 4/1/2023 10 90 4/27/2023 5/1/2023 4 10 To get what you expect, you would need to:
1) create another segmentation table named segment2 from Exel or with DAX, like this:
GapSegment Min Max <0 -5 -1 <5 -5 5 <10 -5 10 (Note: no need to relate the tables.)
2) Write a measure like this:
Seg2Amt = VAR _min = MIN(segment2[Min]) VAR _max = MAX(segment2[Max]) RETURN CALCULATE( SUM(data[Amt]), data[Gap]>=_min && data[Gap] <=_max )3) plot the measure with the [GapSegment] column in a table visual.
I tried and it worked like this:
So you see, the point is to create an independent segmentation table.
Hi Anonymous
just noticed you wanted a cummulative total, then
Supposing you have the following data:
| ActualDate | DueDate | Gap | Amt |
| 10/5/2022 | 10/1/2022 | -4 | 10 |
| 10/28/2022 | 11/1/2022 | 4 | 50 |
| 11/30/2022 | 12/1/2022 | 1 | 70 |
| 12/26/2022 | 1/1/2023 | 6 | 100 |
| 1/31/2023 | 2/1/2023 | 1 | 10 |
| 2/20/2023 | 3/1/2023 | 9 | 90 |
| 3/22/2023 | 4/1/2023 | 10 | 90 |
| 4/27/2023 | 5/1/2023 | 4 | 10 |
To get what you expect, you would need to:
1) create another segmentation table named segment2 from Exel or with DAX, like this:
| GapSegment | Min | Max |
| <0 | -5 | -1 |
| <5 | -5 | 5 |
| <10 | -5 | 10 |
(Note: no need to relate the tables.)
2) Write a measure like this:
Seg2Amt =
VAR _min = MIN(segment2[Min])
VAR _max = MAX(segment2[Max])
RETURN
CALCULATE(
SUM(data[Amt]),
data[Gap]>=_min
&& data[Gap] <=_max
)
3) plot the measure with the [GapSegment] column in a table visual.
I tried and it worked like this:
So you see, the point is to create an independent segmentation table.
Thanks a Lot. Worked Flawlessly and Amazing Explaination.