Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all, trying to do something which I think is relatively simple but I can't wrap my mind around it.
These are two sets of data, and then I want to combine into one chart. An example is below.
Set 1 -- this is historical data, but refreshed automatically so on 1/21 I'll get new data that looks similar (ideally with more sites finished)
Site | Date | Finished |
A | 1/15/2020 | 1 |
B | 1/15/2020 | 0 |
C | 1/15/2020 | 0 |
D | 1/15/2020 | 0 |
E | 1/15/2020 | 0 |
A | 1/17/2020 | 1 |
B | 1/17/2020 | 0 |
C | 1/17/2020 | 0 |
D | 1/17/2020 | 0 |
E | 1/17/2020 | 1 |
A | 1/19/2020 | 1 |
B | 1/19/2020 | 0 |
C | 1/19/2020 | 0 |
D | 1/19/2020 | 0 |
E | 1/19/2020 | 1 |
I use the measure below to get me percentage done so far. It shows me 20% for 1/15 and 40% for 1/17 and 1/19.
Site | Date | Finished |
B | 1/21/2020 | 1 |
C | 1/23/2020 | 1 |
D | 1/23/2020 | 1 |
What can I use for a measure that would show me 60% on 1/21 and 100% on 1/23, all on the same chart? Note if I combine the data into one table I have to be careful of future "real" data in Set 1 conflicting with the manual data in Set 2. Also I have the date as a shared CALENDARAUTO() table as shown below.
Thanks in advance!!
Solved! Go to Solution.
Hi @brianlehr ,
I have created a sample for your reference, please check the following steps as below.
1. Create a calculated table like that.
Table = CROSSJOIN(DISTINCT('Set 1'[Site ]),UNION(DISTINCT('Set 1'[Date]),DISTINCT('Set 2'[Date])))
2. Based on that, create the two calculated columns as below.
Column =
VAR dat = [Date]
VAR s = [Site ]
RETURN
LOOKUPVALUE (
'Set 1'[Finished],
'Set 1'[Date], [Date],
'Set 1'[Site ], [Site ]
)
+ CALCULATE (
MAX ( 'Set 2'[Finished] ),
FILTER ( 'Set 2', 'Set 2'[Date] = dat && 'Set 2'[Site ] = s )
)
Column 2 =
CALCULATE (
MAX ( 'Table'[Column] ),
FILTER (
'Table',
'Table'[Site ] = EARLIER ( 'Table'[Site ] )
&& 'Table'[Date] <= EARLIER ( 'Table'[Date] )
)
)
3. Then we can get the excepted result by this measure.
Measure = DIVIDE( CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Column 2]=1)),CALCULATE(COUNTROWS('Table')))
For more details, please check the pbix as attached.
Hi @brianlehr ,
I have created a sample for your reference, please check the following steps as below.
1. Create a calculated table like that.
Table = CROSSJOIN(DISTINCT('Set 1'[Site ]),UNION(DISTINCT('Set 1'[Date]),DISTINCT('Set 2'[Date])))
2. Based on that, create the two calculated columns as below.
Column =
VAR dat = [Date]
VAR s = [Site ]
RETURN
LOOKUPVALUE (
'Set 1'[Finished],
'Set 1'[Date], [Date],
'Set 1'[Site ], [Site ]
)
+ CALCULATE (
MAX ( 'Set 2'[Finished] ),
FILTER ( 'Set 2', 'Set 2'[Date] = dat && 'Set 2'[Site ] = s )
)
Column 2 =
CALCULATE (
MAX ( 'Table'[Column] ),
FILTER (
'Table',
'Table'[Site ] = EARLIER ( 'Table'[Site ] )
&& 'Table'[Date] <= EARLIER ( 'Table'[Date] )
)
)
3. Then we can get the excepted result by this measure.
Measure = DIVIDE( CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Column 2]=1)),CALCULATE(COUNTROWS('Table')))
For more details, please check the pbix as attached.
This is perfect. It's the EARLIER that always screws up my thinking. 😀
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
87 | |
65 | |
50 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |